INI settings not taking effect immediately

Problem

Changes to the newrelic.ini file are not taking effect immediately.

Solution

Restart your web server (Apache, Nginx, PHP-FPM, etc.) after you make any changes to your INI settings.

Cause

When your web server (Apache, Nginx, PHP-FPM, etc.) first starts up and initializes PHP, it reads all of the INI settings. It also sets the global defaults for any missing settings.

Apache then creates a pool of "worker" processes to deal with requests. These worker processes inherit the settings set during initialization. You have no way of knowing exactly which worker process will deal with a given request. When you make INI file changes, there may still be hundreds of worker processes left with the old settings, and the main Apache process itself (which will periodically kill existing and spawn new worker processes) also has the original INI settings.

Until you restart your Apache server, most changes to your INI files will go unnoticed. The only exception is if you use PHP's "per-directory" setting mechanism using .htaccess files. Such settings are rare.

For more help

Additional documentation resources include PHP Agent Troubleshooting (individual topics describing common problems, causes, and solutions for your PHP agent installation).

Join the discussion about PHP in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.