2012-09-11 66 views
0

我已经开发了一个使用WordPress的网站。它在本地机器(Windows XP)和测试服务器(Ubuntu)上运行良好。但是在服务器上,它给出了下面给出的错误。在此之前和之后有两个空行,以及这些错误之后。在测试服务器上,我注意到两个空行开始,但它运行良好。wordpress,空白行在页面开始

我试过并删除header.php,index.php和其他一些文件中的空白行,但没有运气。

活网站的网址是http://mbsocial.bsslsites.com

<br /> 
    <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent by (output started at /home/bsslsite/public_html/mbsocial/wp-includes/functions.php:4954) in <b>/home/bsslsite/public_html/mbsocial/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php</b> on line <b>16</b><br /> 
    <br /> 
    <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/bsslsite/public_html/mbsocial/wp-includes/functions.php:4954) in <b>/home/bsslsite/public_html/mbsocial/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php</b> on line <b>16</b><br /> 


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> 
     <head profile="http://gmpg.org/xfn/11"> 
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 

回答

1

来看由错误信息,我要去猜测WPSC-constants.php还有一些空白<?php

+0

在<?php – nbhatti2001

+0

之前wpsc-constants.php中没有黑色空格吗?你确定吗?没有换行符或空格或任何东西?你在任何地方回应什么?该文件的第16行是什么? – slugonamission

+0

是的,没有空间或任何东西。这里是该文件的代码 '<?php // Left Overs $ wpsc_currency_data = array(); $ wpsc_title_data = array(); /** * wpsc_core_load_session() * *加载了WPEC会议 */ 功能wpsc_core_load_session(){ \t如果(isset($ _SESSION)!) \t \t $ _SESSION = NULL; // error_reporting(E_ALL^E_NOTICE^E_WARNING); ((!is_array($ _SESSION))xor(!isset($ _SESSION ['nzshpcrt_cart']))xor(!$ _ SESSION)) } /** * wpsc_core_constants() * *核心WPEC常数需要启动加载 * /' – nbhatti2001

0

你显然需要修复错误。幸运的是,他们指出了你的问题 - wpsc-constants.php的第16行。

似乎你应该正确地配置本地开发和测试环境来显示你的这些错误,并且正确配置你的生产环境来不显示这些错误。

0

出现这种情况的最常见情况是,在设置标题信息(本例中为cookie)之前,您有一个空白字符或一个空行回显给浏览器。我的建议是尝试通过你的主题的functions.php文件和wp-e-commerce/wpsc-core/wpsc-constants.php文件,并确保它们以<?php开头 - 在此之前没有空格或换行符。