最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【未解决】WordPress警告:Warning Cannot modify header information headers already sent by output started at

WordPress crifan 1728浏览 0评论
折腾:
【未解决】修复WordPress登录页死循环:wp-config各种设置
期间,试试:
// define('WP_CACHE', true); //Added by WP-Cache Manager
define('WP_CACHE', false);
结果:
登录页死循环时会有很多警告
Notice: wp_deregister_script的调用方法不正确。脚本和样式应在wp_enqueue_scripts、admin_enqueue_scripts和login_enqueue_scripts钩子之后再加入加载队列(enqueue)或注册(register)。 This notice was triggered by the l10n handle. 请查阅调试WordPress来获取更多信息。 (这个消息是在3.3.0版本添加的。) in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 5225
Notice: Undefined variable: control_ops in /data/wwwroot/www.crifan.com/wp-content/themes/daqianduan-d8-jquiss/widgets/wid-banner.php on line 11
Deprecated: 在d_banner中为WP_Widget调用的构造函数已自版本4.3.0起废弃!请改用__construct()。 in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 4866
Notice: Undefined variable: control_ops in /data/wwwroot/www.crifan.com/wp-content/themes/daqianduan-d8-jquiss/widgets/wid-slidebanner.php on line 11
Deprecated: 在d_slidebanner中为WP_Widget调用的构造函数已自版本4.3.0起废弃!请改用__construct()。 in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 4866
Notice: Undefined variable: control_ops in /data/wwwroot/www.crifan.com/wp-content/themes/daqianduan-d8-jquiss/widgets/wid-readers.php on line 11
Deprecated: 在d_reader中为WP_Widget调用的构造函数已自版本4.3.0起废弃!请改用__construct()。 in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 4866
Notice: Undefined variable: control_ops in /data/wwwroot/www.crifan.com/wp-content/themes/daqianduan-d8-jquiss/widgets/wid-postlist.php on line 11
Deprecated: 在d_postlist中为WP_Widget调用的构造函数已自版本4.3.0起废弃!请改用__construct()。 in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 4866
Notice: Undefined variable: control_ops in /data/wwwroot/www.crifan.com/wp-content/themes/daqianduan-d8-jquiss/widgets/wid-comment.php on line 11
Deprecated: 在d_comment中为WP_Widget调用的构造函数已自版本4.3.0起废弃!请改用__construct()。 in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 4866
Notice: Undefined variable: control_ops in /data/wwwroot/www.crifan.com/wp-content/themes/daqianduan-d8-jquiss/widgets/wid-tags.php on line 11
Deprecated: 在d_tag中为WP_Widget调用的构造函数已自版本4.3.0起废弃!请改用__construct()。 in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 4866
Notice: Undefined variable: control_ops in /data/wwwroot/www.crifan.com/wp-content/themes/daqianduan-d8-jquiss/widgets/wid-textbanner.php on line 11
Deprecated: 在d_textbanner中为WP_Widget调用的构造函数已自版本4.3.0起废弃!请改用__construct()。 in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 4866
Notice: wp_deregister_script的调用方法不正确。不在管理区域中反注册jquery脚本。要将目标定为前端主题,请使用wp_enqueue_scripts钩子。 请查阅调试WordPress来获取更多信息。 (这个消息是在3.6.0版本添加的。) in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 5225
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-login.php on line 521
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-login.php on line 537
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-includes/functions.php on line 6270
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-includes/pluggable.php on line 958
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-includes/pluggable.php on line 960
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-includes/pluggable.php on line 961
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-content/plugins/pwa-for-wp/service-work/class-service-worker.php on line 587

错误:Cookies因预料之外的输出被阻止。要获取帮助,请参见此文档或访问支持论坛。
其中的:
Warning: Cannot modify header information - headers already sent by
感觉最可疑,因为别人提到过
错误:Cookies因预料之外的输出被阻止
“Cookies因预料之外的输出被阻止。要获取帮助,请参见此文档或访问支持论坛。” 的解决方法 – WordPress企业主题网
看起来和缓存有关
所以看来还会恢复WP_CACHE
“Cookies因预料之外的输出被阻止。要获取帮助,请参见此文档或访问支持论坛。” 的解决方法_刘亚伟-CSDN博客
WordPress Cookies因预料之外的输出被阻止_Linux I Tell U-CSDN博客
WordPress解决Cookies因预料之外的输出被阻止-AIDE技术网–技术综合类博客|AIDEZY.COM
http://aidezy.com/3484.html
结果问题依旧。
不过
错误:Cookies因预料之外的输出被阻止
已经没了,还有其他的:
继续去解决之前的:
Cannot modify header information – headers already sent by
wordpress Cannot modify header information – headers already sent by
How to fix Cannot modify header information – headers already sent | WordPress.org
https://wordpress.org/support/topic/how-to-fix-cannot-modify-header-information-headers-already-sent/
“Cannot modify header information” | WordPress.org
https://wordpress.org/support/topic/cannot-modify-header-information-135/
Warning: Cannot modify header information | WordPress.org
https://wordpress.org/support/topic/warning-cannot-modify-header-information-188/
Warning: Cannot modify header information – headers already sent by | WordPress.org
https://wordpress.org/support/topic/warning-cannot-modify-header-information-headers-already-sent-by-86/
Cannot modify header information – headers already sent by | WordPress.org
https://wordpress.org/support/topic/cannot-modify-header-information-headers-already-sent-by-37/
说是有空白字符
去看看
www.crifan.com/wp-includes/functions.php
            trigger_error(
                sprintf(
                    /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: WordPress version number. */
                    __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ),
                    $function,
                    $message,
                    $version
                ),
                E_USER_NOTICE
            );
        } else {
            if ( $version ) {
                $version = sprintf( '(This message was added in version %s.)', $version );
            }
前面的输出,都是这段开始的
再去看看
www.crifan.com/wp-includes/pluggable.php
        // Auth cookies.
        setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
        setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
。。。
看来都是:setcookie相关的
且在此之前,就有几个同样警告了:
Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-login.php on line 521

Warning: Cannot modify header information - headers already sent by (output started at /data/wwwroot/www.crifan.com/wp-includes/functions.php:5225) in /data/wwwroot/www.crifan.com/wp-login.php on line 537
对应代码:
header( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );

setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );
有header,也有setcookie
总之,都是无法设置cookie导致的
PHP whitespace: Headers already sent – Make WordPress Support
此处文件末尾,没有多余:
?>
所以此处不是这个问题
另外去恢复之前的:
        setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
        // setcookie( $auth_cookie_name, $auth_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure, true );
结果:
问题依旧,且又出现了之前的:
错误:Cookies因预料之外的输出被阻止。要获取帮助,请参见此文档或访问支持论坛。
不过,此处cookie可以看到了:
所以:或许是离解决问题,更进了一步?
wordpress Cookies因预料之外的输出被阻止
wordpress解决:Cookies因预料之外的输出被阻止。要获取帮助,请参见此文档或访问支持论坛。 – 奋斗的承诺
去掉:
www.crifan.com/wp-config.php
define('WP_HOME','https://www.crifan.com');
// define('WP_SITEURL','https://www.crifan.com');
加上:清除缓存
结果:问题依旧
wordpress不能正常登录,显示:Cookies因预料之外的输出被阻止…… |
“Cookies因预料之外的输出被阻止。要获取帮助,请参见此文档或访问支持论坛。” 的解决方法 – WordPress企业主题网
-》难道是此处最近Vultr更新服务器,导致我此处php配置变动?
去找找自己此处的CentOS中php的ini设置如何
先去找找
输出缓冲区数据块设置
对应的是哪个变量
php.ini 输出缓冲区数据块设置
问题:设置php输出缓冲区数据块 – 亿恩科技
output_buffering = on/off/xK(x为某个整型数值)
问题:设置php输出缓冲区数据块 | 夜风博客
去看看自己此处的配置
Vultr/usr/local/php/etc/php.ini
output_buffering = On
output_buffering = 4096
是开启的。没问题。
算了,还是没办法。

转载请注明:在路上 » 【未解决】WordPress警告:Warning Cannot modify header information headers already sent by output started at

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.220 seconds, using 22.13MB memory