AppSignal for PHP requirements
There are two requirements to get started with the PHP package:
- An actively supported PHP version. See our maintenance policy.
- The OpenTelemetry PHP extension.
We will guide you through installing the OpenTelemetry extension.
Install OpenTelemetry PHP extension
The OpenTelemetry PHP extension provides hooks in PHP functions that this package uses to instrument your application. This is a PHP extension that you need to install and enable in your PHP environment.
First, make sure the required build dependencies are available on your system.
sudo apt-get install gcc make autoconf
brew install gcc make autoconf
Then, install the OpenTelemetry PHP extension using either PECL, pie, pickle, or docker-php-extension-installer:
pecl install opentelemetry
# Install pie (skip this step if pie is already installed) curl -L https://github.com/php/pie/releases/latest/download/pie.phar -o /usr/local/bin/pie && chmod +x /usr/local/bin/pie # Install the extension pie install open-telemetry/ext-opentelemetry
# Install pickle (skip this step if pickle is already installed) curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle && chmod +x /usr/local/bin/pickle # Install the extension pickle install opentelemetry
# Use the docker-php-extension-installer script in your Dockerfile when using official PHP Docker images ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN install-php-extensions opentelemetry
Finally, enable the extension in your PHP installation's configuration file. The configuration file is usually named php.ini, and its location can be found by running php --ini. Add the following lines to it:
[opentelemetry] extension=opentelemetry.so
Create a new AppSignal application
Please follow the installation guide first, when adding a new application to AppSignal.
At the end of that guide, you will receive a Push API key and a collector endpoint URL. You will need both to configure AppSignal for PHP.