2

我正在WordPress 3.5使用Twenty Eleven 1.5. 突然间我开始关注警告,

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cp_admin_init' was given in /home/templ/public_html/wp-includes/plugin.php on line 406

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '_canonical_charset' was given in /home/templ/public_html/wp-includes/plugin.php on line 173

我正在使用以下插件:

  1. 下载管理器 2.3.9
  2. wordpress-seo 1.4.7
  3. wp-pagenavi 2.83

还有几点:

1)如果我给mysite.com它给出了 2 行以上的警告。如果我给www.mysite.com,以下行还包括,

Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-includes/pluggable.php on line 876

2)如果我给mysite.com/wp-admin/www.mysite.com/wp-admin/,它会给出第一个警告和第三个警告。

3)如果我转到www.mysite.com/wp-login.php,它会给出以下 5 个警告。

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cp_admin_init' was given in /home/templ/public_html/wp-includes/plugin.php on line 406

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '_canonical_charset' was given in /home/templ/public_html/wp-includes/plugin.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 368

Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 380

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wp_authenticate_spam_check' was given in /home/templ/public_html/wp-includes/plugin.php on line 173

4)如果我提供正确的用户名和密码,它不会登录。给出以下问题,

ERROR: Invalid username or incorrect password.
ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.

我正在努力寻找解决方案。我不能。谁能帮我?

4

1 回答 1

0

这听起来像是一个损坏的安装。所以你有几个选项来解决这个问题:

但首先:进行备份

请务必备份您的安装!在继续之前:http ://codex.wordpress.org/WordPress_Backups

让登录工作:掩盖症状

首先,我将禁用调试输出,因为这应该可以解决大部分问题。当 Wordpress 中出现警告时,PHP 开始编写响应正文并关闭响应的标题部分。这意味着每当 Wordpress 在引发原始警告后尝试添加另一个标题时,PHP 都会引发另一个警告:

Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 380

因此,如果我们禁用调试,那么我们应该能够掩盖这些症状。这是一个针对更大问题的快速补丁,我们必须通过就地升级来解决这个问题

禁用调试

确保以下常量存在并正确设置在您的wp-config.php文件中

define('WP_DEBUG', false);

define('WP_DEBUG_DISPLAY', false);

现在您应该能够以管理员身份登录您的站点而不会出错。

禁用你的插件

禁用所有插件Plugins -> Installed Plugins 这是必要的,这样我们才能确保更新顺利进行。

进行更新

转到Dashboard -> Updates并单击Update NowRe-install Now

重新激活您的插件

重新激活所有插件Plugins -> Installed Plugins并在必要时更新它们。

而已

这就是重新安装 Wordpress 的过程。这里的关键是您在生产站点上启用了调试,这并不好。您应该始终拥有WP_DEBUGWP_DEBUG_DISPLAY设置false在生产环境中。

于 2013-11-14T15:00:15.503 回答