现在的位置: 首页 > 服务器相关 > linux类 > 网站建设 > PHP > 网站建设 > 正文

安装wordpress出现:Warning: Cannot modify header information – headers…解决办法

2011年11月18日 linux类, PHP, 网站建设 ⁄ 共 1328字 ⁄ 字号 暂无评论 ⁄ 阅读 595 views 次
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/yoozhu/wp-config.php:1) in/www/htdocs/yoozhu/wp-login.php on line 255Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/yoozhu/wp-config.php:1) in/www/htdocs/yoozhu/wp-login.php on line 267

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/yoozhu/wp-config.php:1) in/www/htdocs/yoozhu/wp-includes/pluggable.php on line 649

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/yoozhu/wp-config.php:1) in/www/htdocs/yoozhu/wp-includes/pluggable.php on line 650

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/yoozhu/wp-config.php:1) in/www/htdocs/yoozhu/wp-includes/pluggable.php on line 651

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/yoozhu/wp-config.php:1) in/www/htdocs/yoozhu/wp-includes/pluggable.php on line 850

 

上网搜索了一下,大致有两种解决方案,整理了一下,主要的造成的原因和解决办法如下:

1.php.ini配置问题,解决办法:打开 php.ini 然后把 output_buffering 设为 on ,重启appache即可。

2.使用windows记事本编辑的wp-config文件造成(UTF8编码和BOM冲突),解决办法:使用Notepad++、UltraEdit、EditPlus等编辑器编辑文件,一般的主机管理系统自带的编辑功能也不错。

如果是安装PHP其他程序或者自己写的程序出现以上问题,除了以上两种可能,还有可能是setcookie的问题,解决办法是在输出内容之前,产生cookie,可以在程序的最上方加入函数 ob_start(); 格式如下:
ob_start :打开输出缓冲区
函数格式:void ob_start(void)

给我留言

留言无头像?


×