WordPress error handling is pretty good, but you do need to do a little work to shape this to your needs:
I can tell you that the most simple set-up I know is to log errors to the wp-content/debug.log file – using the following set-up in wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
You can also extend the information in the log using xdebug – https://xdebug.org/ – but it’s not essential.
This should give you type, line and reason for all PHP error, like:
[30-Dec-2020 19:54:39 UTC] PHP Parse error: syntax error, unexpected 'an' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in C:\xampp\htdocs\file.php on line 10
Related Posts:
- Notice: Constant WP_POST_REVISIONS already defined
- How do I set up Debugging?
- “There doesn’t seem to be a wp-config.php file.” despite wp-config.php in root
- WordPress doesn’t recognise my email address and I’m missing the wp-config file in PHPmyadmin cPanel to make alterations
- Fatal error trace not shown in development setup
- Could not create directory /wp-content/upgrade/
- HTTPS leads to Sorry, you are not allowed to access this page
- What is the best way to monitor PHP functions/executions?
- Showing error “Function create_function() is deprecated”
- error_log over 70GB. How to stop this? [closed]
- Update wordpress fail – There has been a critical error on your website
- Getting headers already sent error from plugin
- “Notice: Undefined index:” error when adding new content?
- Object of class WP_Error could not be converted to string
- New WordPress Error Message – Not seen this before
- Recommend a guide to catching plugin errors, please?
- How to handle core code throwing notice on valid input?
- Getting Warnings & Notices from Fresh WordPress 3.1.2 install
- What do these “Failed to import” errors mean and how do I fix it?
- Trying to get property of non-object in wp-includes/capabilities.php
- How to use add_settings_error in register_setting callback
- Application passwords not working on localhost?
- WordPress home page doesn’t work, but other pages do. How to rectify?
- File available but giving 404 in wordpress
- Only on 404 page, get notice: trying to get property of non-object on nonce
- In big trouble – Allowed memory size of 268435456 bytes exhausted
- PHP Warning : A non-numeric value encountered
- Wordpres debug.log PHP Notice: is_singular was called
- Warning: Declaration of QuietSkin::feedback error
- Getting 403 Access Denied Error Message in new WordPress Post
- Error wordpress “Call to undefined function aq_resize()” [closed]
- Sorry, you are not allowed to access this page dashboard
- err_connection_closed after 20 minutes when loggedin in backend
- How to Fix “Are You Sure You Want to Do This”, while uploading my theme?
- Homepage Not Found Error [closed]
- 4.2.2 stuck in an db upgrade loop with “Call to undefined method wpdb::get_col_length()”
- Fatal error: Allowed memory size of 146800640 bytes exhausted (tried to allocate 57 bytes) in public_html/wp-includes/rewrite.php on line 1561
- Display all WP Errors together during form validation
- Updating posts exceeds maximum execution time
- “Cannot modify header information” means I can’t use wp_redirect
- How can I use wordpress functionality outside of WP framework
- hypanis.ru wordpress vulnerabilty [closed]
- Why do get_category_by_slug() crashes WordPress 4.8
- Child Theme Fatal Error [closed]
- Overwrote index.php. When I restored it, I got lots of Notice level errors
- 403 forbidden access to my whole site
- Warning: require_once(/home/onetwo/public_html/wp-config.php): [closed]
- Constant WP_CRON_LOCK_TIMEOUT already defined in /htdocs/wp-config.php
- Downgrade from latest nightly build to latest stable version
- styles/default.css in markup, where does it come from? [closed]
- Warning: call_user_func_array() [function.call-user-func-array]
- Parse error: syntax error, unexpected [closed]
- Undefined index error on options array element?
- Getting no Error Log File saved to my local directory, and no debug info displayed in the web browser
- Error call_user_func_array() After Installing Plugin
- Help with “Uncaught Error: Attempt to modify property “response” on bool”
- Error regarding invalid file permissions for upgrading WordPress version
- How to solve the error “Oops! That page can’t be found” when access Portfolio
- Replace form field error text?
- Publication in wrong category
- “File not found.” appears often while navigating wp-admin
- Getting file errors in a WordPress Multisite ADMIN
- Why does this show up when i try to log in
- WordPress Error blank page In section website
- How can I make error messages in admin
- Posts, pages and some images are deleted sometimes
- how do i fix these errors my debug log gave me?
- Fatal error: Call to undefined function wp_add_privacy_policy_content() in /wp-admin/includes/misc.php on line 1822
- WordPress won’t save page/post with more than 332 words
- Dashboard widget, screen options/help doesn’t work?
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- Getting amp; on every single category, post and page title. How to Remove?
- Site has fake users registered with a similar pattern in username and email
- A SINGLE Post Giving an “Under Maintenance” Message
- Weird Cron Error
- Seeing “error” as text on white when accessing admin
- Unregister Settings Error
- bypassing permission error for a plugin’s page
- Website Loading Very Slow, Each Time Different File Takes Very Long To Load
- Fatal error: Allowed memory size of bytes exhausted (tried to allocate 36 bytes)
- 500 internal server error with wordpress
- call user func array error after moved the site to new server
- Any idea on how to fix this error when forcing SSL on a certain page?
- do_action( ‘init’ ) in wp-settings.php breaks my website. All plugins and themes disabled
- WP_Error message
- Avoiding “headers already sent” in WordPress
- Unexpected error with class-wp-hook.php on WordPress
- Fatal error: Call to undefined function wp_raise_memory_limit()
- problem ajaxurl – designthemes-core-features
- Help with overloading the limits of CPU/RAM issue in a resseler account with wp sites
- WordPress “Allowed memory size” on wp-db.php [closed]
- Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ [closed]
- undefined index [closed]
- Only specific users timing out
- How to fix Notice: unserialize(): Error at offset 12620 of 12651 bytes error?
- syntax error, unexpected ‘=>’ (T_DOUBLE_ARROW) [closed]
- Error code 499 on specific cron job
- Please Help Me, How to Fix PHP Error Undefined Array Key “srcset”
- My websit dosent worke http errors 500
- 403 forbidden in admin console: fix seems to be temporary and then error is back