What are some common methods for monitoring server performance in PHP?

One common method for monitoring server performance in PHP is by using a tool like New Relic or Blackfire. These tools provide detailed insights into the performance of your PHP application, including response times, database queries, and memory usage. By monitoring server performance, you can identify bottlenecks and optimize your code for better efficiency.

// Example using New Relic PHP agent
if (extension_loaded('newrelic')) {
    newrelic_name_transaction("MyTransactionName");
}