不寻常的'头已经发送'错误。没有空白也没有改变标题 [英] Unusual 'Headers already sent' error. No whitespace nor changing of the header

查看:112
本文介绍了不寻常的'头已经发送'错误。没有空白也没有改变标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在使用wordpress插件,并且在提交时收到以下错误:

在开始告诉我这个错误已经有1000万个帖子的情况下,我的编辑页面:

 警告:无法修改标题信息 - 已经发送的标题(输出开始于*** \ wp- content \plugins\ *** \meta-class-load.php:1067)in *** \wp-includes\pluggable.php on line 934 

这个错误的不同之处在于它引用的行不与页眉连接,也没有在之前输出内容。我检查了周围php标签的空白,并且没有:P



这是1067行的内容(和环绕声):

  $ name = $ field ['id']; 
$ type = $ field ['type'];
$ old = $ this-> get_meta($ post-> ID,$ field); //这是行
$ new = isset($ _ POST [$ name])? $ _POST [$ name]:($ field ['multiple']?array():'');

任何想法或解决方案都会有帮助。谢谢!

解决方案

如果您发送 HEADER 这样做你将无法发送标题,它会引发错误!

设置 error_reporting(0)也是一个好习惯生产服务器以确保在


之前没有显示任何错误

Before you start telling me there are already 10000000 posts on this error, I know.

I am working on a wordpress plugin and am recieving the following error when submitting my edit pages:

Warning: Cannot modify header information - headers already sent by (output started at ***\wp-content\plugins\***\meta-class-load.php:1067) in ***\wp-includes\pluggable.php on line 934

What's different about this error is the line it references does not interface with the header, nor output content before. I have checked for whitespace surrounding php tags, and there is none :P

This is the contents (and surrounds) of line 1067:

        $name = $field['id'];
        $type = $field['type'];
        $old  = $this->get_meta($post->ID, $field); // THIS IS THE LINE
        $new = isset($_POST[$name]) ? $_POST[$name] : ($field['multiple'] ? array() : '');

Any ideas or solutions would be helpful. Thanks!

解决方案

Never output anything before sending the HEADER, if you do so you will not be able to send the header and it will throw an error !
It's also a good practice to set error_reporting(0) on production server to make sure that no error gets shown before header

这篇关于不寻常的'头已经发送'错误。没有空白也没有改变标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆