gpt4 book ai didi

PHP 和 WordPress : Debugging

转载 作者:可可西里 更新时间:2023-10-31 23:03:48 25 4
gpt4 key购买 nike

我正在为 WordPress 编写一些插件和主题,我发现很难调试,因为不知何故,当页面加载时,$_GET、$_POST 和 $_REQUEST 都是空的。即使设置了错误报告,每当出现 fatal error 时,除了空白页面外,我也不会收到错误消息。有没有办法为 WordPress 启用“ Debug模式”?

谢谢!

最佳答案

Pear Debug Wordpress 插件:http://wordpress.org/extend/plugins/wp-pear-debug/

2015 年 8 月 4 日更新:上述插件已经几年没有更新了。您还可以在 wp-config.php 中使用内置的 WordPress PHP 调试功能,即:

  // Enable WP_DEBUG mode
define('WP_DEBUG', true);

// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define('SCRIPT_DEBUG', true);

参见 https://codex.wordpress.org/Debugging_in_WordPress获取完整文档

关于PHP 和 WordPress : Debugging,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1080679/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com