Warning: newrelic already loaded

Hi,

I’m using newrelic to monitor several applications in my shared hosting account @webfaction. It works great and the information I get is very useful. Today I checked the log files and noticed that my php log file get this warning for very php execution:

[10-May-2014 04:58:13 UTC] PHP Warning: Module ‘newrelic’ already loaded in Unknown on line 0
[10-May-2014 04:58:16 UTC] PHP Warning: Module ‘newrelic’ already loaded in Unknown on line 0
[10-May-2014 04:58:17 UTC] PHP Warning: Module ‘newrelic’ already loaded in Unknown on line 0
[10-May-2014 04:58:18 UTC] PHP Warning: Module ‘newrelic’ already loaded in Unknown on line 0

Is it possible to configure the client to get rid of them? I tried already to change error_reporting inside the php.ini file, but this doesn’t helped.

These warnings are typically caused from having multiple:

extension="newrelic.so"

lines in your php.ini, newrelic.ini, etc. Check out the .ini files that are getting parsed (phpinfo()), and make sure there is only a single line loading the New Relic PHP agent.

Same problem

/etc/php5/apache2/conf.d/05-opcache.ini, /etc/php5/apache2/conf.d/10-pdo.ini, /etc/php5/apache2/conf.d/20-gd.ini, /etc/php5/apache2/conf.d/20-json.ini, /etc/php5/apache2/conf.d/20-mcrypt.ini, /etc/php5/apache2/conf.d/20-mysql.ini, /etc/php5/apache2/conf.d/20-mysqli.ini, /etc/php5/apache2/conf.d/20-newrelic.ini, /etc/php5/apache2/conf.d/20-pdo_mysql.ini, /etc/php5/apache2/conf.d/20-readline.ini, /etc/php5/apache2/conf.d/newrelic.ini

I would recommend checking out this thread’s post that discusses the same issue with a possible resolution. Many people were able to resolve it by removing their newrelic.ini when their conf.d directory held both a newrelic.ini and a 20-newrelic.ini.

October 10th. Can not believe this issue hasn’t been resolved. It still happening. What causing two nerelic.ini files?

According to your phpinfo(), are

/etc/php5/apache2/conf.d/20-newrelic.ini, 
/etc/php5/apache2/conf.d/newrelic.ini

both getting parsed at this time? As Max has advised, you should try to remove the newrelic.ini to avoid this warning.

Hey BCollins,
Thank you for the reply. Well. I have removed that file 1 day ago and I still get the issue, maybe I need to reboot the system. I think I maybe know what causing this issue. Instructions for installing PHP application and Server tracking are pretty much the same. So, we maybe accidentally install some components twice.

Second thing… I have this info while doing apt-get update and that is why I assume this:

W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free amd64 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-amd64_Packages)

W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free i386 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-i386_Packages)

Often changes like this can necessitate restarting at least the daemon. Have you tried restarting at this point and if so, has it helped alleviate the problem?

Hey Lisa, sorry for the delay. Yes, I’ve reboot the whole machine. It hasn’t helped I still get that Cron mail.

B U T

I have just now seen that I have newrelic.ini in /etc/php5/CLI/conf.d/ not only apache2 I think I have solved the problem…

But I still seeing

W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free amd64 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-amd64_Packages)

W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free i386 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-i386_Packages)

when running apt-get update and upgrade it still remains…

Here is my lib package file http://pastebin.com/hfNyEs5w

Hi @jovic_zarko

The message you are seeing indicates that you have newrelic listed twice in your sources.list to resolve this issue you should comment out one of the newrelic entries.

The apt file for New Relic is in /etc/apt/sources.list.d/newrelic.list so that’s where duplicates should be removed from.

1 Like

Thank you for offering help @kermit!

The duplicate .ini file problem is a problem within you installation routines. Just try the following:

Install NewRelic as described here: https://docs.newrelic.com/docs/agents/php-agent/installation/php-agent-installation-ubuntu-debian

And now it gets interesting:

  • Install newrelic-php5
  • It places a already configured file /etc/php5/mods-available/newrelic.ini with a symlink to /etc/php5/apache2/conf.d/20-newrelic.ini
  • Run sudo newrelic-install install (This is where it breaks)
  • newrelic-install does some $foo and places /etc/php5/apache2/conf.d/newrelic.ini as a file. But it does not clean up the already placed files/symlinks /etc/php5/mods-available/newrelic.ini /etc/php5/apache2/conf.d/20-newrelic.ini

After doing the describe steps you have:

  • /etc/php5/apache2/conf.d/20-newrelic.ini and /etc/php5/apache2/conf.d/newrelic.ini
  • Both contain the following line
 extension = "newrelic.so"

Here is a full log of what I did: http://pastebin.com/XQv8vfhw

Oh and if you already touching the deb package please ensure that a “apt-get purge newrelic-php5” cleans everything which it places…

Please fix this a soon as possible!

Thank you for that very detailed explanation, @mbaur! I will get this information to our developers. We sincerely appreciate your help in improving our product!

The documentation has still not been corrected.