New Relic not working as expected

Hi, we installed new relic and every time we run a php file from the command line the info appear at new relic dashboard, so it works, but is not detecting the execution of the php on the webserver from the live traffic.

The server hosts a Wordpress installation over we built an api for a mobile app, so there is no website to see but every request from the app to the server executes php files, for example this /api/service/promo/ consumes a request to the API which is a wp plugin.

So we want to know if there is something we need to do in order to get newrelic work because as I wrote, when we run a php file from command line it works, and the log file doesn’t show any errors except lack of activity if I don’t run any php files from CL

We also tried to set wordpress as the framework in the newrelic.ini file but didn’t work.

[root@]# apachectl -V

[Mon Nov 06 11:33:46.989057 2017] [so:warn] [pid 18184] AH01574: module rewrite_module is already loaded, skipping

Server version: Apache/2.4.6 (Red Hat Enterprise Linux)

Server built: Dec 2 2014 08:09:42

Server’s Module Magic Number: 20120211:24

Server loaded: APR 1.4.8, APR-UTIL 1.5.2

Compiled using: APR 1.4.8, APR-UTIL 1.5.2

Architecture: 64-bit

Server MPM: prefork

threaded: no

forked: yes (variable process count)

Server compiled with…



-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)







-D HTTPD_ROOT="/etc/httpd"

-D SUEXEC_BIN="/usr/sbin/suexec"

-D DEFAULT_PIDLOG="/run/httpd/"

-D DEFAULT_SCOREBOARD=“logs/apache_runtime_status”

-D DEFAULT_ERRORLOG=“logs/error_log”

-D AP_TYPES_CONFIG_FILE=“conf/mime.types”

-D SERVER_CONFIG_FILE=“conf/httpd.conf”

[root@]# php -v

PHP 5.4.16 (cli) (built: Jun 10 2015 04:34:17)

Copyright © 1997-2013 The PHP Group

Zend Engine v2.4.0, Copyright © 1998-2013 Zend Technologies


Hi Daniel,

This can happen when you have a different php.ini or even different installation being used for your web and command line. The first step is to create a phpinfo() page and put it in your Wordpress directory (you want to see exactly how PHP is configured for your Wordpress site) and see if New Relic is being listed in the installed modules. Since it isn’t reporting your Wordpress site, I’m guessing it isn’t loaded but there can be other issues it will point out.

Next, your phpinfo page will tell you what php.ini is being loaded by your web server and what additional .ini directory is loaded. Depending on the setup you’ll either need to add the newrelic.ini to the additional .ini directory or add the New Relic settings from that file to the php.ini used by Apache.

Hopefully that points you to the problem!

Hi, Yes, we created a php info file in the Wordpress directory and New Relic appears as a installed module and is showing the appname value from newrelic.ini, which is the same app where we saw the reports in the dashboard coming from php files executed from the command line.

The php info shows this:

Configuration File (php.ini) Path /etc
Loaded Configuration File /etc/php.ini

Additional .ini files parsed /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/json.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/newrelic.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/soap.ini, /etc/php.d/sqlite3.ini, /etc/php.d/wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zip.ini

New Relic RPM Monitoring enabled
New Relic Version (“weber” - “cf3e11bb4908”)

And there is no reference of newrelic in /etc/php.ini file, so I just need to add extension = “” right ?

Thank you

Hi checking the logs I found this

warning: daemon connect(fd=14 uds=/tmp/.newrelic.sock) returned -1 errno=ENOENT. Failed to connect to the newrelic-daemon. Please make sure that there is a properly configured newrelic-daemon running. For additional assistance, please see:

but if I run /etc/init.d/newrelic-daemon status it says
newrelic-daemon is running...

and /var/log/newrelic/newrelic-daemon.log shows this

2017/11/07 09:11:21.727163 (12176) Info: Reporting to:
2017/11/07 09:11:21.727612 (12176) Info: app 'BAM App' connected with run id '436708976355924940'
2017/11/07 09:21:48.154751 (4132) Info: New Relic daemon version [listen="/tmp/.newrelic.sock" ssl=enabled startup=agent pid=4132 ppid=4130 uid=0 euid=0 gid=0 egid=0 runtime="go1.8.3" GOMAXPROCS=12 GOOS=linux GOARCH=amd64]
2017/11/07 09:21:48.165123 (4138) Info: New Relic daemon version [listen="/tmp/.newrelic.sock" ssl=enabled startup=agent pid=4138 ppid=1 uid=0 euid=0 gid=0 egid=0 runtime="go1.8.3" GOMAXPROCS=12 GOOS=linux GOARCH=amd64]
2017/11/07 09:57:39.290202 (6505) Info: New Relic daemon version [listen="/tmp/.newrelic.sock" ssl=enabled startup=agent pid=6505 ppid=6503 uid=0 euid=0 gid=0 egid=0 runtime="go1.8.3" GOMAXPROCS=12 GOOS=linux GOARCH=amd64]

Could anyone help me to know whats happening and how to fix it ?


It looks like that while the daemon is running and the agent is looking in the correct file path for the socket file, some security issue is preventing the agent from connecting to that socket. One workaround is to use an abstract socket instead of a filepath such as @newrelic-daemon.

You can find more about this and other socket connection errors in this excellent post:

1 Like