Advertisement
borlabs

WordPress Error Logging

Aug 26th, 2019
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. define('WP_DEBUG', true);
  2. define('WP_DEBUG_DISPLAY', false);
  3. ini_set('log_errors',TRUE);
  4. ini_set('error_reporting', E_ALL);
  5. ini_set('error_log', dirname(__FILE__) . '/error-logs/php.log');
  6.  
  7. if (!file_exists(dirname(__FILE__) . '/error-logs') && is_writable(dirname(__FILE__))) {
  8.     mkdir(dirname(__FILE__) . '/error-logs');
  9. }
  10.  
  11. if (file_exists(dirname(__FILE__) . '/error-logs') && !file_exists(dirname(__FILE__) . '/error-logs/.htaccess')) {
  12.     file_put_contents(dirname(__FILE__) . '/error-logs/.htaccess', "AuthType Basic\nAuthName \"Restricted Access\"\nAuthUserFile .htnopasswd\nAuthGroupFile /dev/null\nRequire valid-user");
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement