Our PHP agent monitors your application to help you identify and solve performance issues. You can also extend the agent's performance monitoring to collect and analyze business data to help you improve the customer experience and make data-driven business decisions.
Use the New Relic PHP agent to solve your app's performance issues with our My app is slow tutorial.
Monitor app performance
one.newrelic.com > All capabilities > APM & services > (select an app) > Summary: After installing the PHP agent, view a summary of your app's performance.
View the big picture of your app
- Monitor your app's Apdex (user satisfaction)
- Get a high-level summary of your app
- Create architectural maps of your app
Find errors and problems quickly
- Track key transactions
- Search and create customizable charts for the metric timeslice data most important to you, including any custom metrics you are sending to New Relic.
- Alert your team when errors or problems occur before they affect your users
- Track performance after a deploy
Drill down into performance details
- Examine code-level transaction traces
- Examine database query traces
- Examine error traces
View logs for your infrastructure data
Bring your logs and application's data together to make troubleshooting easier and faster. No need to switch to another UI page.
- With logs in context, you can see log messages related to your errors and traces directly in your app's UI.
- You can also see logs in context of your infrastructure data, such as Kubernetes clusters.
Analyze business data
Use the PHP agent to organize, query, and visualize your data to answer key questions about application performance and customer experience.
- Use default transaction attributes or add your own
- Query your data using NRQL
- Send your own event data
- Create and share customizable, interactive dashboards
Architecture
The PHP agent has two binaries that work together to forward data to New Relic:
- The agent handles automatic and API instrumentation of your PHP code.
- The daemon acts as a proxy between the agent and the New Relic platform.
You can connect up to 500 applications/agents to one daemon. The daemon imposes sampling when the harvest cycle limits are reached, so consider this when deciding how many applications/agents to connect to a single daemon.
ヒント
The number of applications/agents per daemon may be lower when running in separate Docker containers, depending on the capacity of the connection between containers.
The flow of data from your PHP applications to New Relic.
The workflow between your application and New Relic must occur in this order:
- The agent establishes a socket connection with the daemon by sending the first payload of instrumentation data.
- The daemon establishes an HTTPS link with the New Relic platform. The daemon must be invoked before your instrumented application is invoked. This is called agent mode and is the default.
To avoid losing reported data, make sure your instrumented application doesn't send transactions before both connections are established.
Install the agent
Before you install the PHP agent, ensure your system meets the system requirements. The PHP agent supports many of the most common PHP frameworks, databases, and libraries. You can also use the agent in a Google App Engine (GAE) flexible environment.
ヒント
If you are installing the agent on a shared hosting service, ensure you have root permissions to install the agent or contact your hosting provider for technical assistance.
To install the agent, sign up for New Relic first. Once logged in, use our launcher, or see the instructions for specific installations.
For standard installations, see:
- PHP agent installation overview (the basic installation steps for the most common setups).
- Installing on RedHat or CentOS
- Installing on Ubuntu or Debian
- Installing with tar archive (generic method to use on any supported systems such as Linux variants, OpenSolaris, SmartOS, FreeBSD, macOS, etc)
- The newrelic-install script (how to use the interactive script that automates some installation tasks)
For other types of PHP installations and advanced installation topics, see:
- PHP agent installation: Non-standard PHP
- Starting the PHP daemon (a standard New Relic installation starts the daemon automatically, but you can also start the daemon manually)
- Silent mode for the install script
- Google App Engine (GAE) flex environment installation for New Relic's PHP agent
Configure the agent
The agent includes a variety of configuration options to further customize and fine-tune your installation.
ヒント
The most important part of agent configuration is to give your app a descriptive name. New Relic uses this app name to aggregate metrics when you have multiple apps or hosts.
After changing any agent configuration options, restart your web server.
Extend agent instrumentation
After installing the agent, go further and extend the agent's instrumentation:
- Page load timing: Integrate the PHP agent with to gain visibility into end-user activity.
- Custom instrumentation: Instrument transactions not captured as part of our framework instrumentation.
- Agent API: Use the agent API to customize the agent's behavior. For example, you can collect custom metrics, flag an error, or ignore a particular transaction entirely.
- Agent attributes: Customize the attributes attached to transactions. Customizing attributes allows you to avoid sending sensitive attributes, or to collect additional attributes for deeper visibility into your transactions.
Troubleshoot your installation
If you're having problems, see the PHP agent troubleshooting docs. Some of the most important troubleshooting docs in that section include: