This document provides an overview for installing the New Relic PHP agent.
The agent consists of a PHP extension (collects data from your application) and a local proxy daemon (transmits the data to New Relic). Your system configuration (such as the web server, operating system, system permissions, PHP installation itself, package manager, etc.) is an important factor during installation and configuration, because the agent is a part of it.
Install PHP via partnership accounts
Installation procedures may be different for admins who install the PHP agent via a partnership. For more information, see:
Not all partners support PHP agents.
Install the agent
Follow this general process to install the agent on your system. The agent installation package/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
dpkgcommands. Typically, running the newrelic-install script is not required.
- Tar archive
- Your operating system is not listed here.
- You are not using a package manager.
- Other methods are unsuccessful.
- 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.).
If your application has infrequent activity, it's recommended you generate some data by using the app for a few seconds. This will help ensure the agent is initiated.
- Wait a few minutes for your application to send data to New Relic.
For more help
Additional documentation resources include:
- New Relic for PHP (overview of agent functionality, requirements, and installation)
- Upgrading the PHP agent (steps for upgrading the agent by platform)
- Uninstalling the PHP agent (steps for uninstalling the agent by platform)
- The newrelic-install script (steps for using the install script to install and uninstall the agent)
- Installing with RedHat and CentOS, Ubuntu and Debian, Tar archive (detailed, system-specific installation instructions)
- Non-standard PHP (detailed information on troubleshooting the newrelic-install script and performing a manual installation)