WordPress 警告Warning:Cannot modify header information – headers already sent by
WordPress 警告Warning:Cannot modify header information – headers already sent by
問題描述:
在升級(jí)WordPress 到新的版本或者是全新安裝之后,在瀏覽器里遇到這樣的錯(cuò)誤:Warning:Cannot modify header information – headers already sent by (output started at /path/blog/wp-config.php:34)
解決辦法:刪掉 wp-config.php 里面多余的空格,空行以及其他無用信息。
1. 通過 FTP 下載 wp-config.php 文件
2. 打開 wp-cinfig.php
3. 去除<?php 前面的所有空格。
4. 確保第一個(gè)字段是 <?php 并且 <?php 在第一行而且中間沒有空格。

5.去除 ?> 后的所有空格。
6. 確保最后的字符是 ?>,放到最后一行,確保中間沒有空格。

這個(gè)錯(cuò)誤可以發(fā)生在其他的文件。仔細(xì)閱讀錯(cuò)誤信息,上面有記錄出錯(cuò)的文件的位置的。