Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1) in D:\AppServ\www\home\mybag1\public_html\includes\functions\sessions.php on line 108Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1) in D:\AppServ\www\home\mybag1\public_html\includes\functions\sessions.php on line 108
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1) in D:\AppServ\www\home\mybag1\public_html\admin\includes\init_includes\init_templates.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1) in D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\general.php on line 22这是错误提示下面是我的admin下的configdefine('HTTP_SERVER', 'http://localhost:80');
define('HTTPS_SERVER', 'https://localhost:80');
define('HTTP_CATALOG_SERVER', 'http://localhost:80');
define('HTTPS_CATALOG_SERVER', 'https://localhost:80');// Use secure webserver for catalog module and/or admin areas?
define('ENABLE_SSL_CATALOG', 'false');
define('ENABLE_SSL_ADMIN', 'false');// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_ADMIN', '/admin/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/admin/');
define('DIR_WS_HTTPS_CATALOG', '/');define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_ADMIN', 'D:/AppServ/www/home/mybag1/public_html/admin/');
define('DIR_FS_CATALOG', 'D:/AppServ/www/home/mybag1/public_html/');
define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'root');
define('DB_SERVER_PASSWORD', 't123');
define('DB_DATABASE', 'mybag1');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'db');
// for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage// The next 2 "defines" are for SQL cache support.
// For SQL_CACHE_METHOD, you can select from: none, database, or file
// If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
// or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
// ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
define('SQL_CACHE_METHOD', 'none');
define('DIR_FS_SQL_CACHE', 'D:/AppServ/www/home/mybag1/public_html/cache');
这是 php.ini
DocumentRoot "D:/AppServ/www/home/mybag1/public_html"
数据库session 目录
'D:/AppServ/www/home/mybag1/public_html/cache'
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1) in D:\AppServ\www\home\mybag1\public_html\admin\includes\init_includes\init_templates.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1) in D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\general.php on line 22这是错误提示下面是我的admin下的configdefine('HTTP_SERVER', 'http://localhost:80');
define('HTTPS_SERVER', 'https://localhost:80');
define('HTTP_CATALOG_SERVER', 'http://localhost:80');
define('HTTPS_CATALOG_SERVER', 'https://localhost:80');// Use secure webserver for catalog module and/or admin areas?
define('ENABLE_SSL_CATALOG', 'false');
define('ENABLE_SSL_ADMIN', 'false');// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_ADMIN', '/admin/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/admin/');
define('DIR_WS_HTTPS_CATALOG', '/');define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_ADMIN', 'D:/AppServ/www/home/mybag1/public_html/admin/');
define('DIR_FS_CATALOG', 'D:/AppServ/www/home/mybag1/public_html/');
define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'root');
define('DB_SERVER_PASSWORD', 't123');
define('DB_DATABASE', 'mybag1');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'db');
// for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage// The next 2 "defines" are for SQL cache support.
// For SQL_CACHE_METHOD, you can select from: none, database, or file
// If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
// or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
// ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
define('SQL_CACHE_METHOD', 'none');
define('DIR_FS_SQL_CACHE', 'D:/AppServ/www/home/mybag1/public_html/cache');
这是 php.ini
DocumentRoot "D:/AppServ/www/home/mybag1/public_html"
数据库session 目录
'D:/AppServ/www/home/mybag1/public_html/cache'
D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php这个文件的问题在header 发送完了之后,还操作 http header 了
在空间中好使,就说明代码没有问题的,配置文件需要修改一下。建议如下:下载一个zen cart的代码在本地重新安装一下,然后用生成configure.php文件覆盖你从空间中下载的代码的配置文件。最好把前后台中的configure.php都重新替换一下。
config.admin_profiles.php 这个文件重新覆盖了一下错误成了这个
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles11.php:1) in D:\AppServ\www\home\mybag1\public_html\includes\functions\sessions.php on line 108Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles11.php:1) in D:\AppServ\www\home\mybag1\public_html\includes\functions\sessions.php on line 108
Fatal error: Cannot redeclare strip_suffix() (previously declared in D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\admin_profiles.php:11) in D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\admin_profiles.php on line 24
这个function在D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\admin_profiles.php中是不是被重新定义了?
$autoLoadConfig[70][] = array('autoType'=>'require',
'loadFile'=> DIR_WS_FUNCTIONS . 'admin_profiles.php');
?>这是admin_profiles.php
没有修改空间中好使,本地不好使 session 应该没有输出问题 空间都不报错,移到本地程序也不能多输出呀
这个function在D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\admin_profiles.php
这个问题可能是你在一个文件中包含了多次(可能是子文件和父文件中都有包含)
你的问题就解决了
建议:把config文件,删了,重新在写一边,你可以,写一行,编译一行,这样应该不会出错。看你上面的错误,应该处在了config中。【个人意见】
你吧session.php贴出来看看;
上面的错误说的很具体,session.php108行,出错,config.admin_profiles.php,里第一行,已经有输出了。
/**
* functions/sessions.php
* Session functions
*
* @package functions
* @copyright Copyright 2003-2007 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: sessions.php 6662 2007-08-12 21:37:17Z wilt $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
if (STORE_SESSIONS == 'db') {
if (defined('DIR_WS_ADMIN')) {
if (!$SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900)) {
$SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900);
}
} else {
if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
$SESS_LIFE = 1440;
}
} function _sess_open($save_path, $session_name) {
return true;
} function _sess_close() {
return true;
} function _sess_read($key) {
global $db;
$qid = "select value
from " . TABLE_SESSIONS . "
where sesskey = '" . zen_db_input($key) . "'
and expiry > '" . time() . "'"; $value = $db->Execute($qid); if (isset($value->fields['value']) && $value->fields['value']) {
return $value->fields['value'];
} return ("");
} function _sess_write($key, $val) {
global $db;
if (!is_object($db)) {
//PHP 5.2.0 bug workaround ...
$db = new queryFactory();
$db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
} global $SESS_LIFE; $expiry = time() + $SESS_LIFE;
$value = $val; $qid = "select count(*) as total
from " . TABLE_SESSIONS . "
where sesskey = '" . zen_db_input($key) . "'"; $total = $db->Execute($qid); if ($total->fields['total'] > 0) {
$sql = "update " . TABLE_SESSIONS . "
set expiry = '" . zen_db_input($expiry) . "', value = '" . zen_db_input($value) . "'
where sesskey = '" . zen_db_input($key) . "'"; return $db->Execute($sql); } else {
$sql = "insert into " . TABLE_SESSIONS . "
values ('" . zen_db_input($key) . "', '" . zen_db_input($expiry) . "', '" .
zen_db_input($value) . "')"; return $db->Execute($sql); }
} function _sess_destroy($key) {
global $db;
$sql = "delete from " . TABLE_SESSIONS . " where sesskey = '" . zen_db_input($key) . "'";
return $db->Execute($sql);
} function _sess_gc($maxlifetime) {
global $db;
$sql = "delete from " . TABLE_SESSIONS . " where expiry < " . time();
$db->Execute($sql);
return true;
} session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
} function zen_session_start() {
@ini_set('session.gc_probability', 1);
@ini_set('session.gc_divisor', 2);
if (defined('DIR_WS_ADMIN')) {
@ini_set('session.gc_maxlifetime', (SESSION_TIMEOUT_ADMIN < 900 ? (SESSION_TIMEOUT_ADMIN + 900) : SESSION_TIMEOUT_ADMIN));
}
$temp = session_start();
if (!isset($_SESSION['securityToken'])) {
$_SESSION['securityToken'] = md5(uniqid(rand(), true));
}
if (ereg_replace('[a-zA-Z0-9]', '', session_id()) != '') session_regenerate_id();
return $temp;
} function zen_session_register($variable) {
die('This function has been deprecated. Please use Register Globals Off compatible code');
} function zen_session_is_registered($variable) {
die('This function has been deprecated. Please use Register Globals Off compatible code');
} function zen_session_unregister($variable) {
die('This function has been deprecated. Please use Register Globals Off compatible code');
} function zen_session_id($sessid = '') {
if (!empty($sessid)) {
return session_id($sessid);
} else {
return session_id();
}
} function zen_session_name($name = '') {
if (!empty($name)) {
return session_name($name);
} else {
return session_name();
}
} function zen_session_close() {
if (function_exists('session_close')) {
return session_close();
}
} function zen_session_destroy() {
return session_destroy();
} function zen_session_save_path($path = '') {
if (!empty($path)) {
return session_save_path($path);
} else {
return session_save_path();
}
} function zen_session_recreate() {
global $http_domain, $https_domain, $current_domain;
if ($http_domain == $https_domain) {
$saveSession = $_SESSION;
$oldSessID = session_id();
session_regenerate_id();
$newSessID = session_id();
session_id($oldSessID);
session_id($newSessID);
if (STORE_SESSIONS == 'db') {
session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}
session_start();
$_SESSION = $saveSession;
if (IS_ADMIN_FLAG !== true) {
whos_online_session_recreate($oldSessID, $newSessID);
}
} else {
/*
$saveSession = $_SESSION;
$oldSessID = session_id();
session_regenerate_id();
$newSessID = session_id();
session_id($oldSessID);
session_destroy();
session_id($newSessID);
session_set_cookie_params(0, '/', (zen_not_null($http_domain) ? $http_domain : ''));
session_id($newSessID);
if (STORE_SESSIONS == 'db') {
session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}
session_start();
session_set_cookie_params(0, '/', (zen_not_null($current_domain) ? $current_domain : ''));
session_start();
$_SESSION = $saveSession;
*/
}
}
?>
建议下个该版本的原始代码,然后用其中的admin文件夹以及其下所有文件替换你工作目录中admin。
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1) in D:\AppServ\www\home\mybag1\public_html\includes\functions\sessions.php on line 108 在D:\AppServ\www\home\mybag1\public_html\includes\functions\sessions.php 108行
发现D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php 第1行有输出