WordPress问题解决: 网站搬家后台显示500错误

WordPress问题解决: 网站搬家后台显示500错误_第1张图片

WordPress网站搬完家, 访问后台显示500错误.

解决办法

WordPress启用开发者模式

修改wp-config.php
添加define( 'WP_DEBUG', true );

分析错误详细信息

再次访问后台, 显示:

Fatal error: Uncaught Error: [] operator not supported for strings in /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/includes/framework/base-admin.class.php:72 Stack trace: #0 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/admin/revslider-admin.class.php(572): RevSliderBaseAdmin::addMetaBox('Revolution Slid...', '', Array, NULL) #1 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/admin/revslider-admin.class.php(73): RevSliderAdmin->addSliderMetaBox() #2 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/admin/revslider-admin.class.php(44): RevSliderAdmin->init() #3 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/revslider.php(162): RevSliderAdmin->__construct('/home/wwwroot/w...') #4 /home/wwwroot/www.wmsoho.com/wp-settings.php(303): include_once('/home/wwwroot/w...') #5 /home/wwwroot/www.wmsoho.com/wp-config.php(87): require_once('/home/wwwroot/w...') #6 /home/wwwroot/www.wmsoho.com/wp-load.php(37): req in /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/includes/framework/base-admin.class.php on line 72

可以看出是RevSlider插件的第72行self::$arrMetaBoxes[] = $box;有问题. Google一番, 发现插件开发者已经给出了解决方案.

修改文件

修改/wp-content/plugins/revslider/includes/framework/base-admin.class.php文件

说明: 有些老版本的RevSlider插件, 目录是在:
/wp-content/plugins/revslider/inc_php/framework/base_admin.class.php 第23行

将第21行
private static $arrMetaBoxes = ”; //option boxes that will be added to post
改为
private static $arrMetaBoxes = array(); //option boxes that will be added to post

保存后重新访问www.wmsoho.com后台,问题解决.

禁用开发者模式

最后修改wp-config.php文件
删除define( 'WP_DEBUG', true );

更新:
还有另外一个错误:

Notice: add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available. in /home/wwwroot/www.wmsoho.com/wp-includes/functions.php on line 4026

Fatal error: Uncaught Error: Call to undefined function mysql_error() in /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/inc_php/framework/db.class.php:29 Stack trace: #0 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/inc_php/framework/db.class.php(125): UniteDBRev->checkForErrors('fetch') #1 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/inc_php/revslider_params.class.php(42): UniteDBRev->fetch('wp_revslider_se...') #2 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/inc_php/revslider_operations.class.php(1030): RevSliderParams->getFieldFromDB('general') #3 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/settings/general_settings.php(41): RevOperations::getGeneralSettingsValues() #4 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/inc_php/framework/base_admin.class.php(341): require('/home/wwwroot/w...') #5 /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/revslider_admin.php(56): UniteBaseAdminClassRev::requireSettings('general_setting...') #6 /h in /home/wwwroot/www.wmsoho.com/wp-content/plugins/revslider/inc_php/framework/db.class.php on line 29

解决方法
修改/wp-content/plugins/revslider/inc_php/framework/db.class.php第29行
if(mysql_error()){
改为
if($this->wpdb->last_error){

mysql_error()在PHP7中已经停止使用, 所以插件出问题.
当然, 更好的办法是更新插件到最新版本.

你可能感兴趣的:(WordPress)