[英]Warning: Cannot modify header information - headers already sent by
Hi there I have seen similar problems on the net about this issue but the resolutions I have tried have not worked. 嗨,我在网上看到有关此问题的类似问题,但我尝试过的解决方案均无效。
i'm developing a word-press site for a client I have done this before without issue. 我正在为客户开发一个wordpress网站,而我之前没有遇到任何问题。 However, this time when I uploaded the template to my test server for the clients viewing I encountered these errors.
但是,这一次,当我将模板上载到测试服务器以查看客户端时,遇到了这些错误。
Warning: Cannot modify header information - headers already sent by (output started at /homepages/0/d682858018/htdocs/clickandbuilds/test/wp-includes/option.php:1) in /homepages/0/d682858018/htdocs/clickandbuilds/test/wp-includes/option.php on line 808
警告:无法修改标题信息-/ homepages / 0 / d682858018 / htdocs / clickandbuilds /中已发送的标题(输出始于/homepages/0/d682858018/htdocs/clickandbuilds/test/wp-includes/option.php:1)第808行的test / wp-includes / option.php
Warning: Cannot modify header information - headers already sent by (output started at /homepages/0/d682858018/htdocs/clickandbuilds/test/wp-includes/option.php:1) in /homepages/0/d682858018/htdocs/clickandbuilds/test/wp-includes/option.php on line 809
警告:无法修改标题信息-/ homepages / 0 / d682858018 / htdocs / clickandbuilds /中已发送的标题(输出始于/homepages/0/d682858018/htdocs/clickandbuilds/test/wp-includes/option.php:1)第809行的test / wp-includes / option.php
I have gone to the file and the lines it is referring to are ; 我已经去了文件,它所指的行是;
// The cookie is not set in the current browser or the saved value is newer.
$secure = ( 'https' === parse_url( admin_url(), PHP_URL_SCHEME ) );
setcookie( 'wp-settings-' . $user_id, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );
setcookie( 'wp-settings-time-' . $user_id, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );
$_COOKIE['wp-settings-' . $user_id] = $settings;
Would appreciate some guidance as to what is causing the error and how to fix it. 希望对导致错误的原因及其解决方法提供一些指导。
Things I have tried; 我尝试过的东西;
Some people have marked this question as similar to another question but as I have mentioned this is different it's something to do with the template. 有人将这个问题标记为与另一个问题类似,但是正如我所提到的,这是不同的,这与模板有关。 It works fine locally
它在本地工作正常
尝试通过文件管理器上传模板,然后在wp-admin中将其激活。
Found the issue when I actually viewed the code in a separate editor it highlighter a space before the opening 当我实际上在单独的编辑器中查看代码时发现了问题,它在打开之前以高亮显示一个空格
Thanks for everyones comments. 感谢大家的评论。
for me this error was in my Prestashop site(v 1.6.0.6) homepage and solved by lowering site php version from 5.6 to 5.3 in cpanel => MultiPHP Manager section. 对我来说,此错误在我的Prestashop网站(v 1.6.0.6)主页中,并且通过将cpanel => MultiPHP Manager部分中的站点php版本从5.6降低到5.3解决。
so if you prefer more detail and manual editing, check .htaccess file and add following line to it 因此,如果您希望更多细节和手动编辑,请检查.htaccess文件,并在其中添加以下行
AddHandler application/x-httpd-php53.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.