Update the PHP agent

To take full advantage of New Relic's latest features, enhancements, and important security patches, we recommend you update your PHP agent to the latest version. For additional information about specific agent updates, refer to the PHP agent release notes.

This document explains how to update the agent for:

  • RedHat and CentOS
  • Ubuntu and Debian

To update via tar archive, follow the tar archive installation procedures. (Procedures to install and update with the tar archive are the same.)

Use newrelic-php5 package

The package name for the New Relic for PHP agent is newrelic-php5.

Although the name references PHP 5, this package works for all supported PHP versions, including PHP 7 versions.

Update using your package manager

To update the PHP agent:

  1. Replace the agent files using your preferred package manager for your system:
    RedHat or CentOS
    Manager Procedures
    yum If you are using the New Relic repositories directly, update 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 UI, 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 UI, 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 Procedures
    apt-get If you are using the New Relic repositories directly, update 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 UI, 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 UI, 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. RedHat or CentOS: Run the newrelic-install script, and follow the install script's confirmation prompt before overwriting an old installation.

    sudo newrelic-install install

    Ubuntu or Debian: Follow the package manager's prompts to run the newrelic-install script as part of its installation 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.

PHP agent versions not supported

End of life notification: As of January 26, 2015, New Relic will no longer accept data from PHP agent versions earlier than 5.0.0.115.

These agent versions use an out-of-date protocol when communicating with New Relic's data collection services. In addition, many of these versions contain a potential security issue where they may incorrectly send sensitive data to the New Relic collector.

Update unsupported agent versions

If you are updating from an older agent version, including major version jumps, review the following list for changes in functionality.

Migration Comments
8.0.0.204

Release notes: PHP agent 8.0.0.204

TLS replaces the newrelic.daemon.ssl ini setting.

To increase security, the newrelic.daemon.ssl ini setting has been removed. Transport Layer Security (TLS) will now always be used in communication with the New Relic collector.

7.0.0.186

Release notes: PHP agent 7.0.0.186

PHP 5.2 is no longer supported.

New Relic highly encourages you to use a supported version of PHP (5.6 or higher). If you want to continue running the New Relic PHP agent with PHP 5.2, we recommend using agent version 6.9. However, in this case, we can only offer limited support.

5.0.0.115

Release notes: PHP agent 5.0.0.115

Daemon command line flags have been renamed.

For customers who start the daemon manually, you can find the newly renamed command line flags with the -h or --help flags. The following old flags will be removed in a future release:

  • [-p pidfile]

  • [-d level]

  • [-c config]

  • [-l logfile]

  • [-P port]

  • [-s]

  • [-n]

  • [-b SSL-certificate-bundle]

  • [-S SSL-certificate-path]

  • [-H host]

  • [-x proxy]

  • [-a auditlog]

Troubleshooting after update

If you updated PHP and the agent stopped working or reporting data, follow the troubleshooting procedures.

For more help

Recommendations for learning more: