欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

CI框架 Cannot modify header information - headers already sent by

程序员文章站 2022-05-23 09:30:33
...
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/fbz/application/models/Content.php:268)

Filename: helpers/url_helper.php

貌似把前面的

$logsession = $this->session->all_userdata();

这句去了也不会报错

回复内容:

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/fbz/application/models/Content.php:268)

Filename: helpers/url_helper.php

貌似把前面的

$logsession = $this->session->all_userdata();

这句去了也不会报错

因为在使用session前已经有输出了
一般是因为php文件?>结尾后有空格回车
或者使用了echo或print

相关标签: php