Community site: login faq

I tried using their tar file, but it requires root access to install. I'd like to use it to monitor my WordPress installation.

asked 23 May '11, 13:25

accept rate: 100%

We have no plans to install New Relic server-wide.

I've looked at the newrelic-install script, and it's clearly not written to be run as any user other than root.

You might be able to work around that by building your own Apache and PHP from source and then manually moving the various components of New Relic into the proper locations within your private Apache/PHP environment, but it's going to be a lot of work, and I really don't know if you'd end up with a working installation after all of that effort.

permanent link

answered 23 May '11, 17:43

accept rate: 37%

ok, thanks

(23 May '11, 19:24) chrispix

Any update on this?

New Relic has become very popular and we'd like to use it on our various apps.

(14 Apr '13, 18:24) PacificDivision

The status has not changed on our end. There are still no plans on adding this. You should still may be able to install as Sean mentioned.

(14 Apr '13, 18:25) bmeyer71 ♦♦

Step 1

First, install a "PHP" or reuse an existing application from the control panel.

Then, mount it to a website record. I'll use "/" for my URL Path to mount it at the root of the domain, but you could mount it at a different URL Path as well; for example "/foo".

Step 2

Next, open an SSH session. Enter the following commands to install New Relic and move the files into place.

mkdir $HOME/pecl_install
cd $HOME/pecl_install
wget https://download.newrelic.com/php_agent/release/newrelic-php5-
tar xzvf newrelic-php5-
cd newrelic-php5-
cp daemon/newrelic-daemon.x64 $HOME/bin/newrelic-daemon
cp scripts/newrelic.cfg.template $HOME/newrelic.cfg
cp scripts/newrelic.ini.template $HOME/webapps/<your php application>/newrelic.ini

# PHP 5.2
mkdir $HOME/php52-exts
cp agent/x64/newrelic-20060613.so $HOME/php54-exts/newrelic.so
echo "extension_dir = $HOME/php52-exts" >> $HOME/webapps/<your php application>/php.ini

# PHP 5.3
mkdir $HOME/php53-exts
cp agent/x64/newrelic-20090626.so $HOME/php54-exts/newrelic.so
echo "extension_dir = $HOME/php53-exts" >> $HOME/webapps/<your php application>/php.ini

# PHP 5.4
mkdir $HOME/php54-exts
cp agent/x64/newrelic-20100525.so $HOME/php54-exts/newrelic.so
echo "extension_dir = $HOME/php54-exts" >> $HOME/webapps/<your php application>/php.ini

# PHP 5.5
mkdir ~/php55-exts
cp agent/x64/newrelic-20121212.so ~/php55-exts/newrelic.so
echo "extension_dir = $HOME/php55-exts" >> ~/webapps/<your php application>/php.ini

# User for all version of PHP
echo "extension = newrelic.so" >> $HOME/webapps/<your php application>/php.ini

Step 3

Edit $HOME/newrelic.cfg, change this setting to a path in your account:

port="/home/<your username>/newrelic.sock"

Step 4

Edit $HOME/webapps/<your php application>/newrelic.ini, change these settings to the paths of your account or to match your new relic settings:

newrelic.license = "<your New Relic License>"
newrelic.logfile = "/home/<your username>/logs/user/php_agent.log"
newrelic.appname = "PHP Application"
newrelic.daemon.logfile = "/home/<your username>/logs/user/newrelic-daemon.log"
newrelic.daemon.port = "/home/<your username>/newrelic.sock"
newrelic.daemon.location = "/home/<your username>/bin/newrelic-daemon"

Step 5

Start the daemon:

$HOME/bin/newrelic-daemon -d info -c $HOME/newrelic.cfg -l $HOME/logs/user/newrelic.log

Step 6

Go to your New Relic Dashboard and add a new application.

Step 7

In the application you created in step one add index.php or rename index.html to index.php. Add some php code to the index.php, for example:

<?php phpinfo(); ?>

Step 8

Visit the domain used in step 1 and check the New Relic dashboard for updates.

** Note this only works on CentOS 6 machines. If you are on a CentOS 5 machine you will need to migrate to a CentOS 6 to use New Relic with PHP.

permanent link

answered 29 Nov '13, 15:56

timg ♦♦
accept rate: 30%

edited 07 Apr '14, 12:45

Thanks for the step by step instructions Tim.

I've followed them and when I go to my New Relic dashboard in order to check if I'm receiving data, I can't see anything.

Is it possible that I have to restart my Apache? If so, how? (I don't have any apache2 directory inside my applications as Sean mentioned here.

I installed the last New Relic agent version:, is it any problem with that?

(29 Jan '14, 10:04) JavierCane

No you do not need to restart apache for installing this PHP version of the new relic monitor. The link above is only if you are running your own apache instance, for example a Django/mod_wsgi application. Be sure that you have used the correct version of the daemon for the version php that your application is in the control panel and that the application you installed the php.ini is mounted on a valid domain in a website in the control panel.

(29 Jan '14, 13:44) timg ♦♦

Thanks a lot for your help Tim.

I was adding a new WebFaction PHP Application instead of installing it into the one that I'm currently using since I was thinking that the New Relic has to be installed only one time per server.

PS: Note that in the instructions for the PHP versions below 5.4 you're specifying a wrong target folder for the cp command.

(30 Jan '14, 09:34) JavierCane

@JavierCane - your confusion is exactly what I had. This:

First, install a "PHP" application from the control panel.

Then, mount it to a website record. I'll use "/" for my URL Path to mount it at the root of the domain, but you could mount it at a different URL Path as well; for example "/foo".

...suggests you have to create a new instance to install to.

(05 Apr '14, 00:55) maz

Thanks for sharing these easy steps. the newrelic daemon is running but doesn't show up in the NR dashboard. I have two questions:

Is it necessary to create a website including working domain? (is this safe?)

Is there a way how I can test any think is fine? The log file doesn't show anything strange:

2014-02-04 14:52:50.069 (19970/main) info: New Relic 4.4 (release build 35 - "ozraptor" - "01be49bf5a052f43a56d8f18632a5dccc5dfed07") [workers=1 listen='/home/myusername/newrelic.sock' pid=19970 ppid=19969 uid=527 euid=527 gid=527 egid=527 backtrace=no os='Linux' rel='2.6.32-358.23.2.el6.x86_64' mach='x86_64' ver='#1 SMP Wed Oct 16 18' node='webXXX.webfaction.com' startup=init] 2014-02-04 14:52:50.069 (19970/main) info: RPM config: proto='https' collector='collector.newrelic.com' proxy='none' certfile='/etc/pki/tls/certs/ca-bundle.crt' certdir='/etc/ssl/certs'

Is it normal that the sockfile has zero bytes?

permanent link

answered 04 Feb '14, 15:04

accept rate: 0%

The application that you add the newrelic.so extension in your php.ini will need to mounted on a domain with a website. Once you have done this, visit a php based page for the domain in your browser and you should see in your New Relic Dashboard. Yes it is normal for the sock file to have zero bytes.

(04 Feb '14, 17:51) timg ♦♦

Thanks for the information, will say I need to chmod the 2 .ini files with 0600 and I'm okay. How should it take until the data is available in the New relic dashboard? Normally it takes just a few minutes :(

(04 Feb '14, 20:02) finalwebsites

You should not need to change the permissions on the files. Once running correctly and you create the new application in new relic it should be available within a few seconds. If you are still having a problem, please open a ticket at our support site, and we'll help you find the cause of the issue.

(04 Feb '14, 20:07) timg ♦♦

How to uninstall it on Webfaction?

permanent link

answered 08 Feb '15, 14:31

Aidas Keburys
accept rate: 0%

Hello Aidas,

You would just need to remove the files and directories you created during the install process using the 'rm -rf' command. Then edit out any changes made to your ini/cfg files or simply delete those files and applications.

Hope this helps.

(08 Feb '15, 22:13) NickR ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 23 May '11, 13:25

question was seen: 30,099 times

last updated: 03 Mar '15, 00:57