关于session_start()的问题我看了很多资料还是不法解决。说的一大推就是关于什么字符编码。打开这个网页报错:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /admin/includes/init_includes/init_file_db_names.php:20) in /html/boseonsale/includes/functions/sessions.php on line 108还有个报错说什么头部信息不能改Cannot modify header information - headers already sent by (output started at )高手说下具体的解决方案吧。本网站是开源的zencart网店
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /admin/includes/init_includes/init_file_db_names.php:20) in /html/boseonsale/includes/functions/sessions.php on line 108还有个报错说什么头部信息不能改Cannot modify header information - headers already sent by (output started at )高手说下具体的解决方案吧。本网站是开源的zencart网店
在执行 sessions.php 第108行处的 session_start() 时,发现在 init_file_db_names.php 的第20行处有输出
你应该检查 init_file_db_names.php 第20行及附近代码从 init_file_db_names.php 这个文件名看,可能是读写文件时出错
die('Illegal Access');
}应该关系不大吧
可能是
你的session_start() 前面就有二進制文字.但是顯示不出來...
就好比:<?
session_start();
?>你看起來已經到最前面了..
其實不是.
決絕辦法 可以用EditPlus 3新建一個php頁面.然後除去session_start()這一段不要複製.自己手寫.
在上傳...試試..
init_file_db_names.php 前30行代码有没有关系不由你决定
session_start();
/**
* @package admin
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: init_file_db_names.php 4240 2006-08-24 10:38:16Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
/**
* load the filename/database table names and he compatiblity functions
*
* @package admin
* @copyright Copyright 2003-2005 zen-cart Development Team
* @copyright Portions Copyright 2003 osCommerce
**/
// set the type of request (secure or not)
$request_type = (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == '1' || strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']),'SSL') || strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),'SSL') ? 'SSL' : 'NONSSL');// set php_self in the local scope
if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];// include the list of project filenames
require(DIR_FS_CATALOG . DIR_WS_INCLUDES . 'filenames.php');// include the list of project database tables
require(DIR_FS_CATALOG . DIR_WS_INCLUDES . 'database_tables.php');// include the list of compatibility issues
require(DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'compatibility.php');// include the list of extra database tables and filenames
$extra_datafiles_dir = DIR_WS_INCLUDES . 'extra_datafiles/';
if ($dir = @dir($extra_datafiles_dir)) {
while ($file = $dir->read()) {
if (!is_dir($extra_datafiles_dir . $file)) {
if (preg_match('/\.php$/', $file) > 0) {
require($extra_datafiles_dir . $file);
}
}
}
$dir->close();
}
?>
<?php
/**
* @package admin
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: init_file_db_names.php 4240 2006-08-24 10:38:16Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
/**
* load the filename/database table names and he compatiblity functions
*
* @package admin
* @copyright Copyright 2003-2005 zen-cart Development Team
* @copyright Portions Copyright 2003 osCommerce
**/
// set the type of request (secure or not)
$request_type = (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == '1' || strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']),'SSL') || strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),'SSL') ? 'SSL' : 'NONSSL');// set php_self in the local scope
if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];// include the list of project filenames
require(DIR_FS_CATALOG . DIR_WS_INCLUDES . 'filenames.php');// include the list of project database tables
require(DIR_FS_CATALOG . DIR_WS_INCLUDES . 'database_tables.php');// include the list of compatibility issues
require(DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'compatibility.php');// include the list of extra database tables and filenames
$extra_datafiles_dir = DIR_WS_INCLUDES . 'extra_datafiles/';
if ($dir = @dir($extra_datafiles_dir)) {
while ($file = $dir->read()) {
if (!is_dir($extra_datafiles_dir . $file)) {
if (preg_match('/\.php$/', $file) > 0) {
require($extra_datafiles_dir . $file);
}
}
}
$dir->close();
}
?>
也是指向init_file_db_names.php 20行的
)。但这里是代码没动过,以前都是好好的能运行,换服务器就不行了。
也查詢了很多資料..說改 php.ini..啦...==
但是我也是無意中自己試了我剛才說的那種方法..再上傳就ok了..
記得選擇另存為...選擇對應項目的編碼.