Apache Error Log

Error logs are necessary for most WordPress troubleshooting. You can access the most recent 24 hours of PHP/Apache error logs in two different ways.


Accessing Error Logs

There are two ways to locate and view your website’s error logs, the WP Engine User Portal and through your WordPress admin dashboard.

User Portal

The best method to access the error logs for your environment is within your WP Engine User Portal. This is because the logs can be easily searched, filtered, and downloaded without needing access to the website’s backend.

  1. Login to the User Portal
  2. Click on the environment name you wish to see logs for
  3. Click Error Logs

WordPress Admin Dashboard

  1. Login to your WordPress dashboard (wp-admin)
  2. Click on the WP Engine tab to access our plugin
  1. Scroll down to Web Server & PHP Error Log
  2. Click the link for the desired log
    • Live Site refers to the site where you are currently logged in
    • Staging Site refers to the legacy staging area

You can copy and save the unique URLs from here so you can access it at any time from any browser in the event your blog is unavailable.


Error Log Entries and Severity

The WP Engine error logs provide you with a trace of how different areas of your site’s code interacts with itself, our server, and WordPress core.

NOTE: This section has technical information geared more towards developers. Plugins and themes do have the ability to add their own logs here as well, so if you see a log not identified here please consult your developer or your plugin/theme author.

Log NameSummarySeverity
PHP Fatal ErrorAn unrecoverable critical function error. Execution terminated.High
Killed QueryQuery terminated because it is over 16,000 characters.High
WordPress Database ErrorLong or numerous MySQL queries being executed.High
curl_execExternal API call that takes more than 500ms.Medium
File PermissionsPHP Warning showing file permissions that are incorrect.Medium
Long QueryQuery terminated because it is over over 1,024 characters.Medium
PHP Parsing ErrorCode is incorrect and could not be ran. Function never executed.Medium
PHP WarningA recoverable critical function error. Executed, not terminated.Medium
session_startSession that is started new or resumed.Medium
NGINX Profile AddedCaching exemption added and not an error.Low
PHP NoticeNon-critical error caused by undefined variable or index.Low

Error Log Examples

We’ve provided some of the more common error long entries below and an brief explanation as to what causes them.

[WPE Monitoring] function.curl_exec
Permission denied
[error] KILL QUERY
[error] LONG QUERY
Nginx Profile Added
PHP Fatal error
PHP Notice
PHP Parsing Error
PHP Warning
[WPE Monitoring] function.session_start
WordPress Database Error
Internal Recursion Error
Enumerate Users


[WPE Monitoring] function.curl_exec

Default PHP Function we’ve added to the error log to show which external API calls are exceeding 500ms; which will add to the total load time of a site and slow it down. This log is intended only for the WP Engine platform to read and is not intended for humans to read. We use this log to help monitor, evaluate, and optimize sites on our platform.


[Mon Jul 14 02:57:21 2014] [error] [client 127.0.0.1] [WPE Monitoring] Stopwatch php.pod-1007.function.curl_exec.duration exceeded 500ms. Was: 1241ms

File Permissions

A permissions error in the error log is a PHP warning. You’ll see this error if a file is trying to be called and the permissions are incorrect. For example, if you uploaded content via SFTP and never reset file permissions via your wp-admin dashboard — both the permissions and the owner/group will be incorrect which will lead to the permission error. You’ll also want to check to ensure the file getting the error actually exists.

PHP Warning: file_put_contents(/nas/wp/www/cluster-1234/yourblog/wp-content/themes/badperms/lib/css/theme.css) [function.file-put-contents]: failed to open stream: Permission denied in /nas/wp/www/cluster-1242/yourblog/wp-content/themes/WFTDAtv/lib/less/lessc.inc.php on line 1418...
[Sat Oct 20 22:38:24 2012] [error] [client 127.0.0.1] PHP Warning: file_put_contents(/nas/wp/www/cluster-1374/yourblog/wp-content/themes/yoo_phoenix_wp/cache/xml-80a72b04a693554d055946d5ad954588.php) [function.file-put-contents]: failed to open stream: Permission denied in /nas/wp/www/cluster-1374/yourblog/wp-content/themes/yoo_phoenix_wp/warp/helpers/xml.php on line 37, referer: http://yourblog.wpestaging.qa/wp-admin/customize.php

You could also see an error like this if a plugin or theme is trying to do something that’s not allowed on our platform or is trying to access a file/directory it shouldn’t have access to:

PHP Warning:  file_put_contents(/nas/wp/www/cluster-2349/yourblog/wp-content/cache/autoptimize/autoptimize_b1b3a88cd5d8cfd4d1b5a716beef375a.php) [function.file-put-contents]: failed to open stream: Permission denied in /nas/wp/www/common/production/php_prevent_flock.php on line 21...

[error] KILLED QUERY

Used to determine which queries of SELECT Statements have been killed and not executed by WP Engine due to the query length being over 16k characters; which is inefficient and should not be ran on a production database.

[Wed Mar 26 06:26:19 2014] [error] [client 127.0.0.1] KILLED QUERY: SELECT DISTINCT `user`.`ID` AS user_id, t.* FROM …

These only apply to Select statements, and not any other type of statements. If these queries need to be run, they should be done so on a local copy of the database that can be downloaded from any backup point in the User Portal. This can be resource intensive; which is why we’ve provided this log. Otherwise, simply shorten the query to resolve the error.


[error] LONG QUERY

Used to determine which queries of SELECT Statements could be optimized due to the character limit being over 1,024.

[Wed Mar 26 06:26:19 2014] [error] [client 127.0.0.1] LONG QUERY: SELECT DISTINCT `user`.`ID` AS user_id, t.* FROM

We have included it in the log to signify that the length of the query, which would be over 1,024 characters, is a Long Query and may be able to be optimized. We did not take any action on this query, it is just a notice to our customers. These only apply to Select statements, and not any other type of statements.


Nginx Profile Added

WPE API [success]: woocommerce Nginx Profile Added – This is not truly an error. With WooCommerce, there are certain caching exemptions that need to be put in place in order for it to function properly. This entry is stating that the nginx profile that contains the necessary cache exemptions has been successfully added to the environment, meaning that the cart and account functions will work as they should.

[Wed Mar 26 06:26:19 2014] [error] [client 127.0.0.1] WPE API [success]: woocommerce Nginx Profile Added

PHP Fatal Error

This is a critical error that can’t be recovered from, such as calling a function that doesn’t exist or there’s not enough memory that’s able to be allocated to the script. If you see a fatal error, it means that the execution of the script was terminated. You can see from the error what plugin/theme/script is causing the issue and in most cases you should be contacting the developer first. PHP fatal errors almost always come from incorrect code.

Function:

PHP Fatal error: Call to undefined function get_current_screen() in /nas/wp/www/cluster-1234/yourblog/wp-content/plugins/leads/modules/wpl.m.post-type.wp-lead.php on line 191, referer: http://yourblog.wpestaging.qa/wp-admin/

Script:

PHP Fatal error:  main() [function.main]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "RealScoutColorScheme" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition  in /nas/wp/www/cluster-1234/yourblog/wp-content/themes/navigator/style.php on line 18, referer: http://yourblog.com/wp-admin/...

Memory:

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 3232498752423 bytes) in /nas/wp/www/cluster-1234/yourblog/wp-includes/taxonomy.php on line 3314, referer:...

Depending on the type of fatal error, a common troubleshooting for memory fatal errors is increasing the memory allocated to PHP. This doesn’t always do the trick, wso contacting your developer is always recommended.


PHP Notice

The script encountered something that could indicate an error, but could also happen in the normal course of running a script. It’s a non-critical error usually caused by an undefined variable or index, so the script is still doing something wrong but the error isn’t serious enough to cause the script to be terminated completely. These errors should still be addressed as they may be indicative of a bug causing problems elsewhere or in the future.

The best course of action is to contact your developer or if it’s specific to a theme/plugin, contact the corresponding author.

PHP Notice: session_start() [function.session-start]: ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in /nas/wp/www/cluster-1234/yourblog/wp-includes/plugin.php on line 470...
PHP Notice: wp_specialchars is deprecated since version 2.8! Use esc_html() instead. in /nas/wp/www/cluster-1234/yourblog/wp-includes/functions.php on line 2908...

PHP Parsing Error

Similar to a fatal error, the biggest difference is a parse error will occur before the script is executed. What this means is that syntax of the code is incorrect and it’s not able to be compiled. This will point to an issue with the code itself. It could be a missing character or an unexpected (unneeded) character/symbol that’s causing it, but you’ll be able to tell exactly which line on which file is troublesome from the output of the error. This will usually be a job for your developer or the author of the identified theme/plugin.

PHP Parse error:  syntax error, unexpected ')' in /nas/wp/www/cluster-1234/yourblog/wp-content/themes/badtheme/functions.php on line 18

PHP Warning

Similar to a PHP Fatal Error in that the Warning shows a script that is malfunctioning, but PHP was able to recover from and the script was not terminated.
Not as serious as a fatal error, but these errors still need to be addressed because they could lead to more serious issues in the future. Just like the fatal error, you’ll want to contact the theme or plugin developer.

PHP Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: error parsing attribute name in Entity, line: 1 in /nas/wp/www/cluster-1234/yourblog/wp-content/plugins/conversations/class/frontend-form-post.php on line 296, referer: http://yourblog.wpestaging.qa/page/breaking-stuff/...
PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /nas/wp/www/cluster-1234/yourblog/wp-content/plugins/hyper-cache/cache.php on line 253, referer: http://warningsandstuff.com/...
PHP Warning: include() [function.include]: Failed opening '/nas/wp/www/cluster-1234/yourblog/wp-content/advanced-cache.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /nas/wp/www/cluster-1234/yourblog/wp-settings.php on line 65...

In the above case there’s nothing to fear. It’s just due to the WordPress core trying to get that advanced cache file, but it’s not included with our installations due to our own proprietary caching mechanisms. This specific error can be ignored, or you can add a blank file called advanced-cache.php to the wp-content directory.


[WPE Monitoring] function.session_start

Default PHP Function we’ve added to the error log to determine when sessions are resumed or opened; which is identified by either a GET, POST, or cookie.
Session data is saved in a serialized format which PHP retrieves and unserializes in order to populate $_SESSION.
This log is intended only for the WP Engine platform to read and is not intended for humans to read. We use this log to help monitor, evaluate, and optimize sites hosted with us

[Mon Jul 14 20:11:29 2014] [error] [client 127.0.0.1] [WPE Monitoring] Stopwatch php.pod-1007.function.session_start.duration exceeded 200ms. Was: 749ms

WordPress Database Error

You’ll see database errors when MySQL is overloaded. Typically, this is due to too many queries being run by multiple users or too many long queries being run at one time. In a case like this, the error message will point you to the offending plugin/theme/script.
Once the offending theme//plugin is located, ensure that the plugin or theme is completely up to date. If updating doesn’t resolve the issue, you’ll want to contact the developer to see about ensuring that queries run less frequently and are optimized. Sometimes enabling object caching can help as well, as hopefully the queries could then be cached.

[Sun Jun 23 00:01:04 2013] [error] [client 127.0.0.1] WordPress database error Lost connection to MySQL server during query for query...
[Sun Jun 23 00:01:04 2013] [error] [client 127.0.0.1] WordPress database error MySQL server has gone away for query SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('post_tag') AND tr.object_id IN (789) ORDER BY t.name ASC /* From [www.yourblog.com/2011/01/22/this-page-breaks-the-database/] in [/nas/wp/www/cluster-1234/yourblog/wp-content/plugins/seo-image/seo-friendly images.php:174] */ made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/freshlife/single.php'), the_content, apply_filters('the_content'), call_user_func_array, seo_friendly_images, preg_replace_callback, seo_friendly_images_process, get_the_tags, get_the_terms, wp_get_object_terms
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 0, 5 /* From [yourblog.com/?s=crossknowledge] in [/nas/wp/www/cluster-' at line 1 for query SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND (((wp_posts.post_title LIKE '%')))  AND (wp_posts.post_password = '')  AND wp_posts.post_type IN ('post', 'page') AND (wp_posts.post_status = 'publish')  ORDER BY FIELD(wp_posts.ID, ) LIMIT 0, 5 /* From [yourblog.com/?s=crossknowledge] in [/nas/wp/www/cluster-1234/yourblog/index.php:17] */ made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, referer:...

You can also get a database error if the syntax of a query is bad. Like trying to query a table that doesn’t exist as in the error above. When that happens, you will want to get in contact with your developer or the developer of the plugin/theme (if the error is specific to a plugin or theme) to ensure that the queries being generated have good syntax.


Internal Recursion Error

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

This error often means there is a 500 error occurring somewhere on the site. If you’re using a multisite, ensure the asset in question actually exists, as this may also reflect a 404.


User Enumeration

Preventing possible attempt to enumerate users

In short, this is not an error but a sign that our firewall is functioning.

The long explanation is that occasionally “bad” bots scrape post information for author ID info and we are automatically preemptively blocking the request. The requests that are blocked when this error displays are not typically not targeted, but rather a wide sweep of WordPress sites probing for vulnerabilities. For example "GET /?author=4 HTTP/1.0" 403


Security Auditor

WP Engine applies an MU plugin to each WordPress website on our platform that specifically logs security events in your wp-admin dashboard. Although these items are logged in your error log, they are not errors and only reflect that a change has been made to your WordPress website. For more information on the Security Auditor see our guide.

These log entries will include the text auditor:event the followed by one of the following actions:

activated_plugin
deactivated_plugin
switch_theme
upgrader_process_complete
add_user_role
remove_user_role
set_user_role
granted_super_admin
revoked_super_admin
wp_login
user_register
profile_update
deleted_user
retrieve_password_key
updated_option
added_option
deleted_option
users_can_register
default_role
siteurl
home

NEXT STEP: Learn how to automatically backup your logs to Amazon S3

Still need help? Contact support!

We offer support 24 hours a day, 7 days a week, 365 days a year. Log in to your account to get expert one-on-one help.

The best in WordPress hosting.

See why more customers prefer WP Engine over the competition.