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'

解决方案 »

  1.   

    不是这些问题,没有utf-8 bom 格式
      

  2.   

    检查一下这个文件:D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php用php -l
      

  3.   

    output started at D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php:1这个文件之前有输出了。
      

  4.   

    似乎是
    D:\AppServ\www\home\mybag1\public_html\admin\includes\auto_loaders\config.admin_profiles.php这个文件的问题在header 发送完了之后,还操作 http header 了
      

  5.   


    在空间中好使,就说明代码没有问题的,配置文件需要修改一下。建议如下:下载一个zen cart的代码在本地重新安装一下,然后用生成configure.php文件覆盖你从空间中下载的代码的配置文件。最好把前后台中的configure.php都重新替换一下。
      

  6.   

    jack应该不会来csdn的吧, 他都在中文论坛上会帖子的。
      

  7.   

    config的都弄了,也重装了,都不好使
    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
      

  8.   

    在session_start()之前是不能有输出的!!!!
      

  9.   

    Fatal error: Cannot redeclare strip_suffix()strip_suffix()
    这个function在D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\admin_profiles.php中是不是被重新定义了?
      

  10.   

    <?php
    $autoLoadConfig[70][] = array('autoType'=>'require',
                                  'loadFile'=> DIR_WS_FUNCTIONS . 'admin_profiles.php');
    ?>这是admin_profiles.php
    没有修改空间中好使,本地不好使      session 应该没有输出问题    空间都不报错,移到本地程序也不能多输出呀
      

  11.   

    1、查看本地和服务器的php版本是否一致2、查看本地和服务器对ERROR_REPORT的设置是否一致
      

  12.   

    Fatal error: Cannot redeclare strip_suffix() strip_suffix() 
    这个function在D:\AppServ\www\home\mybag1\public_html\admin\includes\functions\admin_profiles.php
    这个问题可能是你在一个文件中包含了多次(可能是子文件和父文件中都有包含)
      

  13.   

    上面的Session报错你在dW中打开你的文件,页面属性-》标题、编码-》包括Unicode 签名(BOM)看这个是不是打上勾的,如果是就去了。
      

  14.   

    把session搞掉
    你的问题就解决了
      

  15.   

    谢谢20楼的方法,不存在bom 不可解决感谢19楼         不存在多个16楼的感谢我试试一会在回复 
      

  16.   

    感谢16楼设置没有问题php也一样服务器的版本就是.几的问题应该没什么问题
      

  17.   

    应该是在session之前有输出,在本机调试应该要改session储存目录
      

  18.   

    有些文件编码被你改动了,正常的应该是utf8文件.
      

  19.   

    用phpinfo()在空间中看一下php版本和配置,再在本地逐项设成一样的,再调试看看。
      

  20.   

    session_start()之前是不能有任何输出的,比如一个空格都不能有,有一个空格,也会报这种错误,我之前也出现过这种错误,当时气死我了,我查了几天都没有查出来。后来我发现可能的原因【个人的理解,仅供你参考】:你以前写这个文件,和现在写这个文件的编码不一直,注意html的编码,和文件本身的编码,是两个不同的编码,也就是说,html有头文件,但是,文件本身你在写的时候,也存在这编码,可能是这两个编码,不一致,我建议你在写的时候,最好调节你的编译器让他们两个一致。
    建议:把config文件,删了,重新在写一边,你可以,写一行,编译一行,这样应该不会出错。看你上面的错误,应该处在了config中。【个人意见】
      

  21.   

    config.php 改过N次  新的用,旧的也用就是不好使编码是没有问题了,因为空间中不出错误phpinfo()  中我一项一项的看过  都对我是搞程序的   这些问题我都看过
      

  22.   

    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 
    你吧session.php贴出来看看;
    上面的错误说的很具体,session.php108行,出错,config.admin_profiles.php,里第一行,已经有输出了。
      

  23.   

    <?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;
          */
        }
      }
    ?>
      

  24.   

    session_start 之前不能有输出error_reporting(0);  看一下程序能不能运行在 <?php 标志前也不要有空格
      

  25.   

    在config.admin_profiles.php中把关于zen_session_start()函数的调用地方注释,包括包含session.php的地方,注释下,看看,这个错误还有没有,session.php这个文件,你的这个 zen_session_start()函数,根本就没有错。
      

  26.   

    你把session.php中的函数zen_session_recreate()中的,session_regenerate_id();注释下,看看。【不确定,完全的猜测,你测试下,不行就算了。】
      

  27.   

    我另外的猜测:就是config,和session页面开头的注释部分,特别是编码部分,
      

  28.   


    建议下个该版本的原始代码,然后用其中的admin文件夹以及其下所有文件替换你工作目录中admin。
      

  29.   

    如果还有问题,建议看看ob_start()的用法
      

  30.   

    错误提示已经很明确了!
    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行有输出
      

  31.   

    大版主终于现身了,嘿嘿admin_profiles.php是插件,可以先卸载掉。然后下载新的插件版本重新安装。