Total Pageviews

Saturday, 26 November 2011

WordPress出现错误时,可以通过 debug 参数调试

WordPress出现错误时,可以通过 debug 参数调试:
根据Wp-config.php的调试功能排错
1、在 wp-config.php 有个 debug 的参数,打开这个参数,修改为:
define(‘WP_DEBUG’, ‘true’);
2、根据报错提示解决问题,比如以下错误:
WordPress database error: [Table './xiaoyijian_com/wp_options' is marked as crashed and should be repaired]
SELECT autoload FROM wp_options WHERE option_name = ‘_transient_doing_cron’
WordPress database error: [Table './xiaoyijian_com/wp_options' is marked as crashed and should be repaired]
SELECT autoload FROM wp_options WHERE option_name = ‘_transient_timeout_doing_cron’
WordPress database error: [Table './xiaoyijian_com/wp_options' is marked as crashed and should be repaired]
SELECT option_ FROM wp_options WHERE option_name = ‘_transient_doing_cron’ LIMIT 1
wp_options 表坏了,需要被修复,使用 mysql 客户端。
进 mysql 使用修复的命令修复:
mysql>repair table wp_options;
也可以通过phpMyAdmin来进行修复。
3、问题解决,关掉 DEBUG。
根据mysql的日志记录排错
在mysql的log日志文件
mysql/data/
里面找到一个.err结尾的文件,打开。看见了一排
‘.\xiaoyijian_com\wp_options’ is marked as crashed and should be repaired
‘.\xiaoyijian_com\wp_options’ is marked as crashed and should be repaired
‘.\xiaoyijian_com\wp_options’ is marked as crashed and should be repaired

No comments:

Post a Comment