php.ini中的session如何设置?

来源:百度知道 编辑:UC知道 时间:2024/05/14 03:06:28
系统一直提示:session保存路径未设置,请问如何解决?
以下是我设置的php.ini,我用的php5
[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;
; As of PHP 4.0.1, you can define the path as:
;
; session.save_path = "/temp"
;
; where N is an integer. Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories. This is useful if you
; or your OS have problems with lots of files in one directory, and is
; a more efficient layout for servers that handle lots of sessions.
;
; NOTE 1: PHP will not create this directory structure automatically.
; You can use the script in the ext/s

/tmp是linux服务器的路径
win版本要写成session.save_path = "C:\Windows\Temp"
也可以直接在C盘下面创建一个目录叫做temp
如果想用默认路径 就删除这条参数

;session.save_path = "/temp"
把前面的分号去掉,并且把路径改为一个实际存在的目录,比如
session.save_path = "C:\Windows\Temp"
如果你真的用的是PHP5的话,默认路径已经设定好了,应该不会提示session保存路径的