Zen-cart Session_start报错导致页面显示空白
zen-cart. 有些由于空间原因。在编辑或者下载文档后会在?>后多加了一空白行。这个导致了前台与后台无法正常显示情况。。经常会出现空白页面。或者是session_start()错误。报错为 头部信息早已发送。 而在添加购物车和支付流程上常出现。以下是症状:
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /home1/megacoll/public_html/shopping/admin/includes/classes/logger.php:106) in /home1/megacoll/public_html/shopping/includes/functions/sessions.php on line 108
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home1/megacoll/public_html/shopping/admin/includes/classes/logger.php:106) in /home1/megacoll/public_html/shopping/includes/functions/sessions.php on line 108
Warning: Cannot modify header information – headers already sent by (output started at /home1/megacoll/public_html/shopping/admin/includes/classes/logger.php:106) in /home1/megacoll/public_html/shopping/admin/includes/init_includes/init_templates.php on line 69
Warning: Cannot modify header information – headers already sent by (output started at /home1/megacoll/public_html/shopping/admin/includes/classes/logger.php:106) in /home1/megacoll/public_html/shopping/admin/includes/functions/general.php on line 37
导致网站后台不能登录。
如果你拥有php.ini的管理权限,Potem,直接编辑php.ini,将output_buffer打开(随便给个1024-4086的值),如果 没有php.ini的权限,但是服务器提供了.htaccess 功能的话,那么在.htaccess中加一句这个东西就可以了:
把所有的php档案都查了还是一样。
最后发现原來主机在 php.ini里沒设定 output_buffering。虽尚未请他们改正,不过先用 .htaccess试了可以。
.htaccess 设定如下:
php_value output_buffering 4096
经测试 。无问题。