Directive Local Value Master Value 
session.auto_start Off Off 
session.bug_compat_42 On On 
session.bug_compat_warn On On 
session.cache_expire 180 180 
session.cache_limiter nocache nocache 
session.cookie_domain no value no value 
session.cookie_lifetime 0 0 
session.cookie_path / / 
session.cookie_secure Off Off 
session.entropy_file no value no value 
session.entropy_length 0 0 
session.gc_dividend 100 100 
session.gc_maxlifetime 1440 1440 
session.gc_probability 1 1 
session.name PHPSESSID PHPSESSID 
session.referer_check no value no value 
session.save_handler files files 
session.save_path /tmp /tmp 
session.serialize_handler php php 
session.use_cookies On On 
session.use_only_cookies Off Off 
session.use_trans_sid Off Off 

解决方案 »

  1.   

    你必須 在根目錄下建立一個 tmp 的目錄
      

  2.   

    如果修改session.save_path /tmp /tmp 这里,就可放在我所修改的目录下是不是??
      

  3.   

    修改php时的设置,你可以将session的目录指定为/tmp,而你是在windows中使用php,将它改为c:\temp或其他的目录(该目录必须存在),如果不存在,你创建一个。
      

  4.   

    谁知道php.ini中session的正确设置啊,请大家帮忙。
      

  5.   

    改为c:\temp后显示:Warning: Cannot send session cookie - headers already sent by (output started at f:\chefei\session_check.php:9) in f:\chefei\session_check.php on line 10Warning: Cannot send session cache limiter - headers already sent (output started at f:\chefei\session_check.php:9) in f:\chefei\session_check.php on line 10
    1
      

  6.   

    你在设置cookie之前不能有任何输出语句。
    记住:
    <html>
    <head>..</head>
    <body>
    <?php
    ....
    ?>
    </body>
    </html>这样的写法中<?php前的那一部分也是输出语句。
      

  7.   

    谢谢大家,我知道了
    session_start()要放在头前
    不过又有一个问题:
    Warning: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
      

  8.   

    谢谢大家,现在彻底解决了,我把register_globals=on就行了
      

  9.   

    php手册中建议register_globals=off,因为打开后好象有安全问题。
      

  10.   

    建议用$_SESSION这个超级数组来存取session变量