Skip to main content

Overview

PHP-based services require you to specify the directory path where the codebase is located. Traces are captured through integration points in PHP scripts and processed using the agent.

Prerequisite

Before you begin, ensure the following requirements are met:

  • PHP Version: 8.1 to 8.4
  • Docker Version: 20.1 or Higher
  • Apache Version: 2.4 or Higher
  • Nginx Version: 1.14 or Higher
  • The command must be executed from the project's root directory.
  • An active internet connection is required while executing the command.

Go to Menu > Settings > APM > Application Registration. Clicking the Application Registration button, you can register a new application. From the application registration screen, select the instrumentation type Host/VM or Docker.

PHP Trace Configuration

FieldDescription
Select AgentSelect the Host/VM where this application is running. You can configure PHP application service for Linux type agent.
LanguageSelect PHP from the language icons.
App Hosting TypeChoose the method your application uses to execute PHP requests. You can select either PHP CLI or PHP FPM.
Web ServerIf you select app hosting type as PHP FPM then you need to select the web server running your application as Apache or Nginx.
Service NameProvide a unique and meaningful name (e.g., ERP).
PHP Directory PathPlease provide complete path where PHP is installed on your system.
Application Config PathIf you select app hosting type as PHP FPM then you need to provide complete path where your application or web server configuration is stored.

Providing these details displays Setup Command to instrument your PHP application. To instrument your PHP application, run the following .sh script. Start collecting Traces by restarting your service.

You can configure Trace ingestion according to the framework used to build the application. The below mentioned are the supported frameworks.

Supported Frameworks

The following frameworks are supported for instrumentation and monitoring. Ensure your application version aligns with the supported versions listed below.

FrameworkVersion(s)
CakePHP4 || 5
CodeIgniter4.0+
Laravel1.2.2+
Symfony1.0.2+
Slim Framework1.1.1+

Configuring the application, you can provide the below details:

FieldDescription
Service Attributes(Tags)Add key–value tags to your application for better filtering and organizing data in Explorer. Attribute keys must be in lowercase (for example, apm.env = prod). To add multiple Key-Value pairs you can click the add icon.
Add Custom ParametersAllows you to define custom sampling or tagging parameters for advanced use cases. These optional parameters are passed to the agent (for example, version=4).

Clicking the Apply Configuration button, the ingestion gets started.

Once the Application is Running, you need to verify the below points:

-  Confirm that the service has been registered successfully.
- On the service registration screen, the Service Trace Collection Status should display "Running."
- The traces will start appearing in the APM Explorer screen.