• /
  • Log in
  • Free account

Use the newrelic-install script for PHP

The interactive newrelic-install script simplifies installing New Relic for PHP applications. It works with multiple PHP installations as well as installations in non-standard locations. Running it will:

  • Copy the correct PHP modules into place.
  • Install sample ini files.
  • Configure the New Relic proxy daemon.

Important

Be sure to review the information about working with multiple installations and non-standard locations before running the script.

Find the installer script

The installer script location depends on how you installed the New Relic PHP agent.

  • Via system package manager: The installation script is in the /usr/bin directory.
  • Via a tarball: The installation script is in the directory where you extracted the tar archive file. The script in the tar distribution includes installation steps otherwise handled by the package manager.

Tip

To use PHP or any other agent, as well as the rest of our observability platform, join the New Relic family! Sign up to create your free account in only a few seconds. Then ingest up to 100GB of data for free each month. Forever.

Work with multiple PHP installations

For newrelic-install to correctly detect multiple installations, ensure your PATH environment variable is correctly set. The newrelic-install script can only install the agent for versions it can find.

If you want to...

Do this...

Specify additional directories

Use the NR_INSTALL_PATH environment variable with a colon-separated list.

Override NR_INSTALL_PATH and PATH

Specify a set of directories in the NR_INSTALL_PHPLIST environment variable as a colon-separated list. These directories must contain either the command line version of PHP or the php-config script.

Invoke the installer script

The script has two modes: install and uninstall. If you invoke it with no arguments you will be prompted to select a mode.

From the command line, run the script at its location:

  • Via system package manager: /usr/bin/newrelic-install
  • Via a tar archive directory: ./newrelic-install

Use the install mode

Important

As of PHP agent version 4.0, the installer will not work properly if it detects a single version of PHP if that version is PHP 5.1, which is deprecated. If you must run PHP 5.1, use PHP agent version 3.9.5.13. If you need help, get support at support.newrelic.com.

Follow this process to install New Relic.

Use the install-daemon mode

Important

Requires PHP agent 9.2 or higher.

To install the daemon without the agent, run newrelic-install with the install_daemon command line option. This may be useful if the daemon is running on a different host or in a different container than the PHP application (as may happen with agent install on containers).

Troubleshoot your PHP installation

If there were problems with the installation process, or if no data appears in APM, review the PHP troubleshooting procedures before contacting New Relic for support. Be sure to attach your archive file to any bug report, as well as the output of the phpinfo() function produced by your web server.

Uninstall mode

You can uninstall New Relic but keep valuable config files (useful when upgrading), or permanently uninstall New Relic from your system.

For more help

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.