Instrumenting PHP CLI Applications
When instrumenting a PHP CLI application, you need to provide for the startup of the proxy daemon, as follows:
- Create the proxy control directory, which is used for agent/proxy communication.
-
In your PHP configuration file,
php.iniorappdynamics_agent.inidepending on your environment, include the following settings:agent.cli_enabled = 1agent.auto_launch_proxy = 0agent.proxy_ctrl_dir = <proxy control directory>If you are using the RPM installer to install the agent you may have configured the proxy control directory using theAPPD_PROXY_CTRL_DIRenvironment variable. See Install the PHP Agent by RPM. This environment variable takes precedence over the setting in the ini file.
-
Before running any traffic through the CLI, run the proxy from the directory
into which you installed the PHP agent, passing the proxy control directory and
proxy log directory as arguments.
Option Description Linux proxy/runProxy <proxy_control_dir> <log_dir>Windows proxy/runProxy.cmd <proxy_control_dir> <log_dir>For example:proxy/runProxy /tmp/proxy.communication /tmp/agentLogsFor the full set of options to runProxy, see Start the PHP Agent Proxy Manually.