PHP Startup: Unable to load dynamic library (NEW RELIC)
On PHP7 CLI, remove /etc/php/7.0/cli/conf.d/newrelic.ini
Ok, I found the answer. I can't describe how grateful I am to @mike in the following post: Error In PHP5 ..Unable to load dynamic library. I ran $ grep -Hrv ";" /etc/php5 | grep -i "extension="
and it returned a large list of files and one of them was newrelic.ini in /etc/php5/cli/conf.d/
which to be honest with you I wasn't even aware was a php directory. So I ran sudo rm -rf /etc/php5/cli/conf.d/newrelic.ini
and restarted nginx and php5-fpm, and problem solved :)
Thanks @WayneWhitty for the suggestions! I am also going to let newrelic know that they should fix that on their uninstall script.
I received the same kind of error when tried to install New Relic for Docker.
I was trying to install it for alpine docker image and used default Linux release, but you should use -musl
release instead.
According to this response from newrelic forum:
Alpine linux has a different C compiler called musl that causes the daemon to fail to start if it is compiled with the standard libc compiler.https://www.musl-libc.org/intro.html 13
For this, we have a separate installer compiled for Alpine linux here:
http://download.newrelic.com/php_agent/release/newrelic-php5-8.6.0.238-linux-musl.tar.gz
Source
Releases
- Make sure that you check the /conf.d folder for PHP. If there are any .ini files there, they will be automatically parsed. If you see anything relating to newrelic, remove it. In your php info file, search for
Additional .ini files parsed
if you want to see what .ini files have been automatically loaded on startup. - Restart Nginx.