Upgrading the PHP agent

The New Relic PHP agent is updated often, and New Relic strongly encourages you to keep it up to date. This document provides steps for upgrading the agent for the following operating systems:

  • RedHat and CentOS
  • Ubuntu and Debian

If you are upgrading via the tar archive, follow the tar archive installation steps. Installing and upgrading via the tar archive are the same.

If you updated PHP and the agent stopped working or reporting data, see Agent stops working after updating PHP.

Upgrading the agent

To upgrade the PHP agent:

  1. Replace the agent files using your preferred package manager for your system:
    RedHat or CentOS
    Manager Directions
    yum If you are using the New Relic repositories directly, upgrade to the latest agent using the following command:
    sudo yum update newrelic-php5
    32-bit rpm Download the newest version of the .rpm files from the New Relic website, and run the following command. Make sure to replace X.X.X.X with the latest New Relic for PHP version number.
    rpm -i newrelic-php5-common-X.X.X.X-1.noarch.rpm newrelic-daemon-X.X.X.X-1.i386.rpm newrelic-php5-X.X.X.X-1.i386.rpm
    64-bit rpm Download the newest version of the .rpm files from the New Relic website, and run the following command. Make sure to replace X.X.X.X with the latest New Relic for PHP version number.
    rpm -i newrelic-php5-common-X.X.X.X-1.noarch.rpm newrelic-daemon-X.X.X.X-1.x86_64.rpm newrelic-php5-X.X.X.X-1.x86_64.rpm
    Ubuntu or Debian
    Manager Directions
    apt-get If you are using the New Relic repositories directly, upgrade to the latest agent using the following command:
    apt-get update
    apt-get install newrelic-php5
    32-bit dpkg Download the newest version of the .deb files from the New Relic website, and run the following command. Make sure to replace X.X.X.X with the latest New Relic for PHP version number.
    dpkg -i newrelic-php5-common_X.X.X.X_all.deb newrelic-daemon_X.X.X.X_i386.deb newrelic-php5_X.X.X.X_i386.deb
    64-bit dpkg Download the newest version of the .deb files from the New Relic website, and run the following command. Make sure to replace X.X.X.X with the latest New Relic for PHP version number.
    dpkg -i newrelic-php5-common_X.X.X.X_all.deb newrelic-daemon_X.X.X.X_amd64.deb newrelic-php5_X.X.X.X_amd64.deb
  2. Run the newrelic-install script if on RedHat or CentOS.

    sudo newrelic-install install

    The script will ask for confirmation before overwriting an old install. For more information, see PHP install script.

    The Ubuntu/Debian package manager handles and prompts you to run the newrelic-install script as part of its install process.

  3. Restart your web server (Apache, Nginx, PHP-FPM, etc.).

  4. Wait a few minutes for your application to send data to New Relic.

For more help

Additional documentation resources include:

Join the discussion about PHP in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

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