Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

How to configure multiple php applications with apache2

configuration

#1

Hi,
Im trying to follow this link https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-appname

For 2 apps newrelic.appname=“App2;App1” is right.

If APP1 is in directory /webroot/app1
APP2 is in directory /webroot/app2

Where to specify this directories with newrelic configuration. ?

I mean how newrelic figures out what directory is associated with the app1?


#2

The newrelic.appname is a PHP variable and can be set any way you set other per-directory PHP values. Assuming you are using Apache’s mod_php you can set this either in your Apache’s configuration in a vhost or in an .htaccess. We’ve documented this here:

https://docs.newrelic.com/docs/agents/php-agent/configuration/php-directory-ini-settings#perdir-apache

But I’d recommend checking a phinfo() page to make sure your Server API is actually Apache2Handler and not something like PHP-FPM as the .htaccess settings will cause 500 errors if mod_php is not enabled. A phpinfo page is also useful to check if your newrelic.appname setting is being picked up.