PHP 5.3.1 安全模式session_start权限问题的解决办法
出现session_start写入权限问题。
提示信息如下:
Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 2023 is not allowed to access /var/tmp/ owned by uid 0 in /configs/config.inc.php on line 9
Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /configs/config.inc.php on line 9
后来在php5的changelog里找到一个bug报告。里面提到一个安全模式的bug。默认session的save_path
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process’s umask.
; http://php.net/session.save-path
; session.save_path = “/tmp”
这样会要校验权限。在php.ini文件里,
显式指定session的save_path为/tmp即
session.save_path = “/tmp”
重启web服务就解决了。
分类: 琐碎收藏