The New Relic PHP agent consists of a PHP extension (which collects data from your application) and a local proxy daemon (which transmits the data to New Relic). Your system's configuration components, including the web server, operating system, system permissions, PHP installation itself, package manager, etc., are all important factors during installation and configuration, because the agent is a part of that. For more information about supported PHP releases, frameworks, and other system requirements, see PHP compatibility and requirements.
Install the agent
Follow this general process to install the agent on your system. The agent installation package or tar archive includes the interactive newrelic-install script, which automates some installation tasks.
If your application is frequently inactive, it's recommended you generate some data by interacting with the application or site. This will help ensure the agent initially connects.
- Ensure your system meets the agent's requirements, including appropriate system permissions.
- If you do not already have a New Relic account, create one.
- From your New Relic Account settings, copy your license key information.
- Install the agent package or tar archive on your system.
- RedHat or CentOS
-
The most common way to install the agent on RedHat or CentOS is with the installation package (.rpm) and the package manager. You can tell the package manager to get it from the New Relic repository, or you can download the .rpm file directly from the New Relic website.
Install the package with your preferred package manager (yum or rpm) and then run the newrelic-install script.
- Ubuntu or Debian
-
Install the package either with
apt-get
or withdpkg
commands. Typically, running the newrelic-install script is not required. - Tar archive
-
The .tar archive method is the most generic method you can use on all supported operating systems. Download the compressed tar archive for your system if any of these situations apply to you:
- Your operating system is not listed here.
- You are not using a package manager.
- Other methods are unsuccessful.
Install the tar archive of the agent on any supported platform.
- Change the default application name to a meaningful name.
- Optional: Change other agent configuration settings to further customize your installation.
- Restart your web server (Apache, Nginx, PHP-FPM, etc.).
- Recommendation: To help ensure the PHP agent is initiated, especially if your application has infrequent activity, generate some data by using the app for a few seconds.
- Wait a few minutes for your application to send data to New Relic.
Then, check your app's performance in the New Relic UI.
Install PHP with partnership accounts
Installation procedures may be different for admins who install the PHP agent through a New Relic partnership. For more information, see:
Not all partners support PHP agents.