SmoothLinux Blog

New Relic Already Loaded Error

03 November, 2014 | newrelic

Last week I started getting emails from cron on one of the servers that I manage with the following error:

Cron [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean
PHP Warning: Module 'newrelic' already loaded in Unknown on line 0
PHP Warning: Module 'newrelic' already loaded in Unknown on line 0

After a week of putting it off I set out of fix the problem. I knew for sure that the cron command was calling newrelic.ini php module more then once but the trick was finding the correct location that was being called more then once.

I went into directory /etc/php5 and ran the find command below:

find . -iname newrelic.ini

This was the results of the find search:

./mods-available/newrelic.ini
./conf.d/newrelic.ini
./cli/conf.d/newrelic.ini <--- This one was my issue

I took a guess and removed /cli/conf.d/newrelic.ini and ran the command from cron email:

/usr/lib/php5/sessionclean

The PHP Warning: "Module 'newrelic' already loaded in Unknown on line 0 error message" was gone. Next I tested my php application to make sure that newrelic module was still being loaded after removing the newrelic.ini file. By loading a php info page and I was able to see the newrelic module was still being loaded with all the correct settings.

Comments

comments powered by Disqus