Skip to content

Instantly share code, notes, and snippets.

@manojhl
Created November 23, 2018 07:01
Show Gist options
  • Save manojhl/592a977838769eec2f8de28b17578744 to your computer and use it in GitHub Desktop.
Save manojhl/592a977838769eec2f8de28b17578744 to your computer and use it in GitHub Desktop.
Debugging config for production - Error reporting
<?php
/**
* Debugging in production
*
* - Set error reporting to true
* - But don't display the errors
* - Instead log the errors in a file
*/
// For PHP
// error_reporting(E_ALL);
@ini_set( 'log_errors', 'On' );
@ini_set( 'display_errors', 'Off' );
@ini_set( 'error_log', '/home/blogwwf/public_html/php_error.log' );
// For WordPress
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment