New Relic for PHP

This section provides information about compatibility and requirements, basic instructions on how to install and configure the PHP agent, and links to more detailed information.

To use the PHP agent:

  1. Make sure your system meets New Relic's PHP compatibility and requirements.
  2. If you do not already have a New Relic account, create one.
  3. From your New Relic Account settings, copy your license key information.
  4. Follow the agent installation procedures for both the PHP extension and the local proxy daemon.
  5. Complete the configuration settings for the agent and optionally the proxy daemon.
  6. Change the default application name to a meaningful name.
  7. Restart Apache or your PHP host program (such as php-fpm) as applicable.
  8. If no data appears after a few minutes, see Troubleshooting your installation.

Also refer to the For more help section in this document.

Compatibility and requirements

Before you install New Relic for PHP, make sure your system meets these requirements.

New Relic PHP Agent Requirements
PHP

5.2, 5.3, 5.4, 5.5, 5.6

  • New Relic recommends the latest release in the PHP 5.4.x or 5.5.x series.
  • PHP 5.1 support was deprecated in release 4.0 of the agent.

Permissions

Installation: Root access is required for most installations.

Running: Root access is not required.

Processor Type

Intel (and compatible) platforms only.

Support for SSE2 instructions is required.

Operating Systems

Linux (x86 and x86_64):

  • RedHat Enterprise Linux (RHEL) 5 or higher
  • CentOS 5.5 or higher
  • Debian 5.0 ("lenny") or higher
  • Ubuntu 9.10 ("Karmic Koala") or higher
  • Any other Linux distribution with kernel 2.6.13 or higher (2.6.26 or higher highly recommended) and glibc 2.5 or higher with Native Posix Threads Library (NPTL) support
SmartOS and Solaris (x64):

Caution: Known issues can occur when using the agent on x86 SmartOS and Solaris systems.

Mac OS X (x86_64 only):
Note: Support for FreeBSD and 32-bit Mac OS X was removed in release 4.6 of the agent.
Web Server

Apache 2.2 or 2.4 via mod_php
Or any web server that supports FastCGI using php-fpm

Frameworks *
  • CakePHP 1.2, 1.3, and 2.x
  • CodeIgniter 2
  • Drupal 6, 7 and 8
  • Joomla 1.5, 1.6, 2.x and 3.x
  • Kohana 3.2 and 3.3
  • Laravel 4.0 and higher
  • Magento 1.5, 1.6, 1.7 and 1.8
  • MediaWiki
  • QDrupal
  • Symfony 1 and 2
  • WordPress
  • Yii 1
  • Zend Framework 1

The New Relic PHP agent's list of frameworks continues to grow. Even if the framework you are using is not listed here, New Relic's engineers may be able to provide you with useful information about your app. For more information, see PHP frameworks: Integrating support for New Relic. Or, if you need help or if you want to request other popular PHP frameworks, get support at support.newrelic.com.

License key

For any installation, you will need your New Relic license key. This is a 40-character hexadecimal string that New Relic provides when you sign up for your account. To view your license key: From the New Relic menu bar, select (account) > Account settings.

Note: For version 3.0 and higher, refer to this information about the New Relic PHP install script and license key settings in the PHP INI file.

Installation


[video link] For PHP installation tips, watch this New Relic video (approximately 1 minute).

The agent has two parts, a PHP extension and a local proxy daemon. Follow the appropriate installation instructions carefully to make sure you have accounted for both.

Note: As part of the installation process, change the default application name to a meaningful name.

For standard installations, see:

For other types of PHP installations, see PHP agent installation: Non-standard PHP.

Configuration

After installing the PHP agent, configure the settings for both the agent and the proxy daemon, and then restart Apache or your alternate web dispatcher as applicable. For more information, see:

phpinfo_nr.png
Sample phpinfo() File: If data does not appear on your New Relic APM dashboard within a few minutes after configuring both the PHP agent and the proxy daemon, check the New Relic section of your phpinfo() file to verify that New Relic is installed.

For information about advanced configuration settings, see:

For more help

Additional documentation resources include:

If you need additional help, get support at support.newrelic.com.