PHP错误WARNING: SESSION_START() [FUNCTION.SESSION-START]解决_PHP
PHP环境:
OS:CentOS release 5.2 (Final)
Apache:
Server version: Apache/2.2.3
Server built: Jan 15 2008 20:33:30
php:
PHP 5.1.6 (cli) (built: May 24 2008 14:07:53)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
报错信息如下:
复制代码 代码如下:
Warning:session_start()[function.session-start]:open(/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR)failed:Permission denied(13)in www_path on line 9
Warning:Unknown:open(/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR)failed:Permission denied(13)in Unknown on line 0
Warning:Unknown:Failed to write session data (files);Please verify that the current setting of session.sav_path is correct (/var/lib/php/session)in Unknown on line 0
解决办法:
方法1、注释掉/etc/php.ini中
session.save_path = “/var/lib/php/session”
方法2、查看apache用户和组,然后将该用户加到session文件夹所处的组中。
方法3,在session_start() 前不要有任何输出!
然后重启Apache;
OK,问题解决!
下一篇: Spring Data JPA学习
推荐阅读
-
PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
-
PHP编译安装时常见错误解决办法
-
表单提交错误后返回内容消失问题的解决方法(PHP网站)
-
PHP错误Cannot use object of type stdClass as array in错误的解决办法
-
nginx加php-fpm出现502 bad gateway错误的5种解决方法
-
Nginx PHP-Fcgi中因PHP执行时间导致504 Gateway Timeout错误解决记录
-
php session_start()关于Cannot send session cache limiter - headers already sent错误解决方法
-
php编译安装常见错误大全和解决方法
-
PHP异常Parse error: syntax error, unexpected T_VAR错误解决方法
-
ThinkPHP调用common/common.php函数提示错误function undefined的解决方法