Set the environment variables before calling PHP, for example:
# DD_PROFILING_ENABLED is not required for v0.82.0+.
export DD_PROFILING_ENABLED=true
export DD_SERVICE=app-name
export DD_ENV=prod
export DD_VERSION=1.3.2
php hello.php
Use the env
directive in the php-fpm’s www.conf
file, for example:
; DD_PROFILING_ENABLED is not required for v0.82.0+
env[DD_PROFILING_ENABLED] = true
env[DD_SERVICE] = app-name
env[DD_ENV] = prod
env[DD_VERSION] = 1.3.2
Use SetEnv
from the server config, virtual host, directory, or .htaccess
file:
# DD_PROFILING_ENABLED is not required for v0.82.0+.
SetEnv DD_PROFILING_ENABLED true
SetEnv DD_SERVICE app-name
SetEnv DD_ENV prod
SetEnv DD_VERSION 1.3.2