---
title: Update the PHP agent
source: https://docs.newrelic.com/docs/apm/agents/php-agent/installation/update-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](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes).

This document explains how to update the agent for:

-   RedHat and CentOS on x86_64
-   Ubuntu and Debian on x86_64

To update via **tar archive**, follow the [tar archive installation procedures](https://docs.newrelic.com/docs/agents/php-agent/installation/php-agent-installation-tar-file). (Procedures to install and update with the tar archive are the same.)

## Use the `newrelic-php5` package [#newrelic-php5]

The package name for New Relic's PHP agent is `newrelic-php5`.

> #### 💡 TIP
>
> Although the package name references PHP 5, this package works for all [supported PHP versions](https://docs.newrelic.com/docs/agents/php-agent/getting-started/php-agent-compatibility-requirements#php-release).

## Update using your package manager [#install-overview]

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: ````bash sudo yum update newrelic-php5 ```  ````                                                                                                                                                                                                                                                                                          |
    | **rpm** | Download the newest version of the `.rpm` files from the [New Relic downloads page](https://download.newrelic.com/pub/newrelic/el5/x86_64/), and run the following command. Make sure to replace `X.X.X.X` with the latest [New Relic for PHP version number](https://docs.newrelic.com/docs/releases/php). ````bash 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: ````bash apt-get update apt-get install newrelic-php5 ```  ````                                                                                                                                                                                                                                                                                     |
    | **dpkg**    | Download the newest version of the `.deb` files from the [New Relic downloads page](https://download.newrelic.com/debian/dists/newrelic/non-free/binary-amd64/), and run the following command. Make sure to replace `X.X.X.X` with the latest [New Relic for PHP version number](https://docs.newrelic.com/docs/releases/php). ````bash 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](https://docs.newrelic.com/docs/php/the-newrelic-install-script) before overwriting an old installation.

    ```bash
    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.  Stop any residual `newrelic-daemon` processes by running

    ```shell
    kill $(pgrep newrelic-daemon)
    ```

    If the `newrelic-daemon` is configured to [start in external mode](https://docs.newrelic.com/docs/agents/php-agent/advanced-installation/starting-php-daemon-advanced#selecting-external), use your operating system's service manager to restart it.
4.  [Restart your web server](https://docs.newrelic.com/docs/agents/php-agent/troubleshooting/why-when-you-must-restart-your-web-server) (Apache, Nginx, PHP-FPM, etc.).
5.  Wait a few minutes for your application to send data to New Relic.

## Update unsupported agent versions [#eol-update]

> #### ⚠️ IMPORTANT
>
> 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](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/php-agent-800204) **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](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/php-agent-700186) **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](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/php-agent-500115) **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 [#troubleshoot]

If you updated PHP and the agent stopped working or reporting data, follow the [troubleshooting procedures](https://docs.newrelic.com/docs/agents/php-agent/troubleshooting/agent-stops-working-after-updating-php).
