PHP error WARNING: SESSION_START() [FUNCTION. ESSION-START] Solution

 Blogger: Li None but Li 2017-05-11 four thousand and twenty-three 3 comments

This article mainly introduces the solution to the PHP error WARNING: SESSION_START() [FUNCTION. ESSION-START]. If you need help, you can refer to it. Sometimes you will encounter this problem when operating a session: Warning: session_start() [function. session start]

System environment: WIN2003+IIS6+PHP5.2.12

 PHP Error.jpg

PHP has the following error:

Warning: session_start()[function.session-start]: ...... Failed: No such file or directory,

You can change the session.auto_start=0 in the php.ini file to session.auto_start=1

If the problem persists after restarting IIS,

That is, the session variable needs the temporary file space of the system and the permission to read and write.

Find session.save_path=in php.ini and set a valid folder path,

For example: session.save_path="c: php5 session_temp" and add the permission of the folder so that everyone has the permission to modify and write.

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

 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

terms of settlement:

Method 1. Comment out session.save_path="/var/lib/php/session" in/etc/php. ini

Method 2: View the apache user and group, and then add the user to the group where the session folder is located.

Method 3: No output before session_start()!

Then restart Apache;

OK, Problem solved!

The End

Published on: 2017-05-11, unless otherwise noted Li Yang's personal blog template demonstration station Original article, please indicate the source for reprinting.