---
title: PHP agent installation: Amazon Linux 2, RedHat, CentOS (x86_64)
source: https://docs.newrelic.com/docs/apm/agents/php-agent/installation/php-agent-installation-aws-linux-redhat-centos
---

> #### ⚠️ IMPORTANT
>
> The New Relic PHP Agent RPM signing key was rotated in March 2026. To continue using the agent uninterrupted, the new key must be imported on all systems installing via rpm/yum with the following command:
>
> `rpm --import https://download.newrelic.com/php_agent/NEWRELIC_RPM_BD2E199C.public`
>
> For more information, refer to the [PHP agent installation: RPM key rotation 2026](https://docs.newrelic.com/docs/apm/agents/php-agent/installation/php-agent-installation-rpm-key-rotation) documentation.

Our PHP agent auto-instruments your code so you can start monitoring applications. Follow this procedure to install New Relic's PHP agent for APM using Amazon Linux 2, RedHat, or CentOS on x86_64 architecture. For installation on aarch64 architecture, please use [tar file](https://docs.newrelic.com/docs/php/php-agent-installation-tar-files) method. **Exception:** If you have an earlier version installed, [upgrade the agent](https://docs.newrelic.com/docs/agents/php-agent/installation/upgrading-php-agent) instead.

## Install the agent [#install]

Even though the package name for New Relic's PHP agent refers to PHP 5, the package works for all [supported PHP versions](https://docs.newrelic.com/docs/agents/php-agent/getting-started/php-agent-compatibility-requirements#php-release).

1.  Make sure you have your license key accessible.
2.  Add the new RPM key
    ```bash
    rpm --import https://download.newrelic.com/php_agent/NEWRELIC_RPM_BD2E199C.public
    ```
3.  Use either of the following ways to obtain the installation package:

    **Tell the package manager (`rpm`) about the New Relic repository**

    ````bash
    sudo rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-4.noarch.rpm
    ```

    ````

    **Download the rpm file from New Relic**

    -   ```
        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
        ```
4.  Install the agent and daemon using your preferred package manager:

    **yum**

    ````bash
    sudo yum install newrelic-php5
    ```

    The first time you install New Relic for PHP, yum prompts you to accept the New Relic public key. New Relic's key ID is `548C16BF`.

    ````

    **rpm**

    Replace `X.X.X.X` with the most recent [PHP agent version number](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes) when you run this command:

    ````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
    ```

    ````

    **tarball**

    If **yum** and **rpm** do not work with your host config, [install from the binary tarball](https://docs.newrelic.com/docs/php/php-agent-installation-tar-files).
5.  Run the `newrelic-install` script and follow the instructions.

    ```bash
    sudo newrelic-install install
    ```
6.  Restart your web server (Apache, NGINX, PHP-FPM, etc.).
7.  Generate traffic to your application, and wait a few minutes for it to send data to New Relic. Then, [check your app's performance in the UI](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/apm-overview-page).
