php.ini中的session如何设置? 20

系统一直提示:session保存路径未设置,请问如何解决?以下是我设置的php.ini,我用的php5[Session];Handlerusedtostore/retri... 系统一直提示: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/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
; use subdirectories for session storage
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
; session.save_path = "/temp"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
;session.save_path = "/temp"

; Whether to use cookies.
session.use_cookies = 1

; This option enables administrators to make their users invulnerable to
; attacks which involve passing session ids in URLs; defaults to 0.
; session.use_only_cookies = 1

; Name of the session (used as cookie name).
session.name = idcbhPHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php

; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.
展开
 我来答
堕落无门
2006-11-11
知道答主
回答量:17
采纳率:0%
帮助的人:0
展开全部
;session.save_path = "/temp"
把前面的分号去掉,并且把路径改为一个实际存在的目录,比如
session.save_path = "C:\Windows\Temp"
如果你真的用的是PHP5的话,默认路径已经设定好了,应该不会提示session保存路径的
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
仍黛守从珊
2019-04-20 · TA获得超过3675个赞
知道大有可为答主
回答量:3073
采纳率:32%
帮助的人:190万
展开全部
php.ini设置参考项:
//处理session存取的模式
session.save_handler
=
files
//session档案存放路径
session.save_path
=
/tmp
//session使用cookie的功能,启动:
1
session.use_cookies
=
1
//session名字
session.name
=
PHPSESSID
//自动启动;0:关;1:开启
session.auto_start
=
0
//session使用cookie的生存期,以秒为单位
session.cookie_lifetime
=
0
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
barby糖
2013-06-26 · TA获得超过112个赞
知道答主
回答量:15
采纳率:0%
帮助的人:4.1万
展开全部
/tmp是linux服务器的路径
win版本要写成session.save_path = "C:\Windows\Temp"
也可以直接在C盘下面创建一个目录叫做temp
如果想用默认路径 就删除这条参数
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式