Skip to content

How to connect New Relic to your localhost machine

Brice Lenfant edited this page Nov 13, 2013 · 5 revisions

New relic is a performance monitoring for PHP that can help you find out what taking to much to render.

Preparation

Register to New relic.

Download New relic PHP agent from here for your local machine and extract it to a easy access folder.

Check the path of the your php folder using the command which php

Copy your license from your account.

Installation

Go to the folder you extracted the php agent to. Type the next command sudo NR_INSTALL_PHPLIST=<your php path> ./newrelic-install and go through the installation.

example: sudo NR_INSTALL_PHPLIST=/Applications/MAMP/bin/php/php5.3.20/bin ./newrelic-install

Restart your apache server.

Settings

Log in to your new relic dashboard and get your license key.

Open your newrelic.ini file(you can locate the file full path using the phpinfo()):

  • on Mac look for new-relic in php info to test installation.

PHP info

Set the value of the variable newrelic.license to your license key you saved before.

Usage

When clicking on Application you'll see your servers:

Application list

Clicking on the PHP application will lead you to the graph of your local machine:

New relic graph

That's it. You can start monitoring your local application and see what's consuming the machine resources.