admin管理员组

文章数量:1122832

I've got the proper debugging constants defined in wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
define('WP_DEBUG_LOG', true);

But they're not doing a darn thing. When I output something to the log file from my plugin (even without testing for WP_DEBUG === true) like this nothing happens on-screen and there's no debug.log to be found either:

error_log('test!');

I'm sure that part of the code in the plug is being executed. What gives? I'm using WP 3.6.1. Thanks.

I've got the proper debugging constants defined in wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
define('WP_DEBUG_LOG', true);

But they're not doing a darn thing. When I output something to the log file from my plugin (even without testing for WP_DEBUG === true) like this nothing happens on-screen and there's no debug.log to be found either:

error_log('test!');

I'm sure that part of the code in the plug is being executed. What gives? I'm using WP 3.6.1. Thanks.

Share Improve this question asked Nov 23, 2013 at 23:14 North KrimslyNorth Krimsly 1111 silver badge6 bronze badges 4
  • Your code works for me. This has to have something to do with your server environment. How much control of the server do you have? Can you access the actual server logs? – s_ha_dum Commented Nov 23, 2013 at 23:33
  • 1 I found out that when using the MAMP Pro environment, the errors are going to the MAMP Apache error log. So I can see the errors there. However I'm still not sure why the errors aren't being displayed on-screen (which they should be since I set WP_DEBUG_DISPLAY to true). Does anyone know why I don't see the errors on-screen? – North Krimsly Commented Nov 23, 2013 at 23:58
  • If in case your WordPress installation have any bug, try Re-Installing WordPress Core from /wp-admin/update-core.php – Mayeenul Islam Commented Nov 24, 2013 at 0:19
  • 2 Create an empty wp-content/debug.log file, and then make sure the web service (Apache) has write permissions to that file. Easiest way is to allow everyone read/write access -- chmod wp-content/debug.log 666. – webaware Commented Nov 24, 2013 at 4:36
Add a comment  | 

1 Answer 1

Reset to default 0

In my case, the below code worked for me. You should enter it in wp-config.php and above /* That's all, stop editing! Happy blogging. */:

@ini_set('display_errors', 1);

本文标签: pluginsUnable to get WPDEBUGWPDEBUGDISPLAYWPDEBUGLOG to work