Skip to main content

PHP Slow Log and FPM Error Log

Improve site stability using PHP Slow Log and PHP FPM Error Log to identify serious performance issues.


This section provides information on how to use the PHP Slow Log and the PHP FPM Error Log to improve your site's performance.

A key way to find issues on your website is to check your PHP logs. You can use your PHP Slow Log and PHP FPM Error Log to find performance issues and PHP errors on Pantheon sites.

Before You Begin

Make sure that you have:

  • An SFTP command line interface (CLI)
  • A working knowledge of PHP

Download the PHP Slow Log and PHP FPM Error Log via SFTP

  1. Add yourself to the site's team membership.
  2. Get the SFTP connection information for the environment (Test, Dev, Live, or a Multidev) from the site's Dashboard.
  3. Open a command line prompt and paste the SFTP connection information.
  4. Navigate to the Logs directory, and use a get command to download the PHP slow log to your local machine for analysis.

Note: If there is no php/ directory in logs/, the files will be located directly within logs.

Analyze the PHP Slow Log

  1. Search for custom modules or theme files (template.php file, *.tpl.php files, etc.). This trace has both a custom Feature module (/sites/all/modules/features/tdm_community.module, field_get_items() function) and a .tpl file (/sites/all/themes/themename/templates/page.tpl.php, render() function).

The script filenames might have a different path such as /srv/bindings/d142301948514750b2ff39988as6f4b9158e5/code/index.php.

  1. Search for contributed modules or plug-ins that may be detrimental to the site. stream_wrappers.inc is showing twice at the exact same timestamp (08-Dec-2014 16:56:48) and is used to bring in external streaming media. This is often the cause of significant performance issues on sites.
  1. Use a grep command to get a count of how many times a given file is called in a PHP slow log. Examples:

By using these methods and files to find your PHP errors and performance issues, you will be able to greatly improve the stability of your website.

More Resources