During development, this problem occurs sometimes when session operations are performed: Warning: session_start () [function. session-start]…
PHP environment:
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
The error message is as follows:
Copy codeThe Code is as follows:
Warning: session_start () [function. session-start]: open (/var/lib/php/session/reset, O_RDWR) failed: Permission denied (13) in www_path on line 9
Warning: Unknown: open (/var/lib/php/session/sess_it1_qua1554rmkgcb8u89ujem5, 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
Solution:
Method 1. Comment out/etc/php. ini
Session. save_path = "/var/lib/php/session"
Method 2: view the apache user and group, and add the user to the group in which the session folder is located.
Method 3: do not have any output before session_start!
Restart Apache;
OK, solve the problem!