PHP Startup: Unable to load dynamic library (NEW RELIC)

Well, that’s why the people at New Relic didn’t really help with this, so I ask you to see here if any of you nice people can help me :)

I am running Ubuntu 12.04 with Nginx and the latest PHP. The story is this: I tried installing the new resident PHP agent according to the instructions for ubuntu:

wget -O - http://download.newrelic.com/548C16BF.gpg | sudo apt-key add - sudo sh -c 'echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > /etc/apt /sources.list.d/newrelic.list' sudo apt-get update sudo apt-get install newrelic-php5 sudo newrelic-install install 

And it does not work. After all that the PHP agent just can't start. I even hacked into the fast phpinfo.php page to see if a new relational module was specified, but not. So, I googled the “New Relic .deb” and came across this page: https://docs.newrelic.com/docs/server/server-monitor-installation-ubuntu-and-debian and followed the instructions. Installation is successful, but the agent does not start either. I like to keep my servers clean, so I decided "OK, since it does not work until the new relic support comes back to me, and I can start with the new one, I will delete the new relic material that was installed." Therefore, I again followed the instructions on this link. The installation seemed to work fine. However, if I execute the " PHP " command, I get the following error:

 root@MYHOSTNAME :/home# php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212 /newrelic.so' - /usr/lib/php5/20121212/newrelic.so: cannot open shared object file: No such file or directory in Unknown on line 0 

I made sure that there is no link to newrelic in my /etc/php/fpm/php.ini file and double-checks to see if there is anything in this folder. Nothing.

So my question is: how do I get rid of an error? How to make PHP stop trying to load this newrelic.so module? Are there any links to it somewhere that I might not see?

Please help me get rid of this error :)

THANKS!

+6
source share
3 answers

Ok, I found the answer. I cannot describe how grateful I am to @mike in the following post: Error in PHP5..Unable to load a dynamic library . I ran $ grep -Hrv ";" /etc/php5 | grep -i "extension=" $ grep -Hrv ";" /etc/php5 | grep -i "extension=" $ grep -Hrv ";" /etc/php5 | grep -i "extension=" and he returned a large list of files, and one of them was newrelic.ini in /etc/php5/cli/conf.d/ , which honestly I didn’t even know if there was a php directory . So I ran sudo rm -rf /etc/php5/cli/conf.d/newrelic.ini and restarted nginx and php5-fpm and the problem is resolved :)

Thanks @WayneWhitty for the suggestions! I will also let newrelic know that they should fix this when they delete the script.

+16
source
  • Make sure you specify the /conf.d folder for PHP. If there are any .ini files there, they will be automatically analyzed. If you see anything related to newrelic, delete it. In your php info file, find Additional .ini files parsed if you want to see which .ini files were loaded automatically at startup.
  • Restart Nginx.
+3
source

In PHP7 CLI, remove / etc / php / 7.0 / cli / conf.d / newrelic.ini

0
source

Source: https://habr.com/ru/post/957235/


All Articles