PHP Warning: Module 'newrelic' already loaded in Unknown on line 0


I updated the agent yesterday. I usually do it as root but was in a hurry and did it with sudo this time.

It seems to have installed it a second time or messed something up because it asked for the licence key again and now I am receiving an email every 30 minutes from the Cron Daemon saying

PHP Warning: Module ‘newrelic’ already loaded in Unknown on line 0

Where do I go from there?

Hey @pyp,

Sounds like something may have been misconfigured during your update.
Would you be able to try removing the agent then doing a fresh install with the latest version?

Please let me know if you require further assistance or have any additional questions.

I tried removing it with apt-get remove newrelic* and reinstall but the error is still there.

That’s odd. Was this run as root or using the sudo command?

Could create a file on your server containing just <?php phpinfo(); ?> and send me a Private Message with a link to it? Please don’t post this link here.

I’m getting the same issue. Didn’t use sudo to do the update, ran as root. It also asked me to enter my licence key again. This was on Ubuntu 12.10.

OK, think I just isolated the cause of it for me. The update had installed a new config ini file in my php conf.d directory (20-newrelic.ini) but the original install was using newrelic.ini so there were two config files trying to load New Relic. Removing the original newrelic.ini has solved the error/warning.


Good job @robadob. Can you check your php confi.d directory too, @pyp?

1 Like

I removed it, let’s see if the error goes away.

That fixed it, thanks.

Same error on Ubuntu 14.04. Deleting the seconde ini file fixed it for me aswel.

Same problem on Ubuntu 14.04 after apt-get update: old newrelict.ini and new 20-newrelict.ini.

Hi @Schlaefer - Have you tried @robadob’s solution?

Yes, that worked. Just wanted to add a datapoint that something wiggled during the update.

I was getting this warning from a cron job that executed php.
To solve it I had to remove /etc/php5/cli/conf.d/newrelic.ini

Had the same problem… removing newrelic.ini solved it for me also.

Have the same problem. Tried the solution suggested but I’m still getting the message

Hey @TpRadebe,
Do you have any other .ini files being detected? You can check this by created a file containing just <?php phpinfo(); ?> and opening it. There will be a section called “Additional .ini files parsed” which will outline any loaded config files,

Yes, I did exactly as you are suggesting and it work but I think the real problem is that i had 2 php applications on my dashboard and opening the wrong application would bring back the newrelic.ini back so I hid one application and its forever gone.

I moved a post to a new topic: Multiple .ini files

Same fix worked for me just now, removing /etc/php/apache2/conf.d/newrelic.ini