PHP服务器 Cookie设置问题-Cannot modify header information - headers already sent by

部署PHP代码到阿里虚拟云主机,出现错误,而在本地一切正常,服务器上却是一版空白。

这个问题困扰了三天,终于解决。

在页面跳转时发现以下错误信息:

Warning:  Cannot modify header information - headers already sent by (output started at 

/data/home/qxu2309260022/htdocs/config/config.php:1) in 

/data/home/qxu2309260022/htdocs/celive/include/celive.class.php on line 66

Warning:  Cannot modify header information - headers already sent by (output started at 

/data/home/qxu2309260022/htdocs/config/config.php:1) in 

/data/home/qxu2309260022/htdocs/celive/include/celive.class.phpon line 68

---------------------------------------------------------------------------------------------

是因为程序需要输出缓冲区数据块output_buffering参数开启,虚拟主机默认该参数设置为关闭状态导致。

 

 

解决方法:登录http://cp.hichina.com控制面板,点击左侧网站高级环境设置--php.ini设置,将【输出缓冲区数据块设置】设置为【启用】,重启服务后生效,设置生效后再测试访问即可恢复正常。

 

 

 

猜你喜欢

转载自just4java.iteye.com/blog/2307297