Get the App
SLTechnology News&Howtos  ›  Development  › 

PHP error WARNING: how to solve SESSION_START ()

Shulou Source: shulou.com Published: 2022-06-03 19:57:59 10月18日 Update

This article mainly introduces "PHP error WARNING: SESSION_START () how to solve". In daily operation, I believe many people have doubts about how to solve the problem of PHP error WARNING: SESSION_START (). The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods, hoping to help you answer the doubts of "PHP error WARNING: SESSION_START () how to solve"! Next, please follow the editor to study!

When doing development, operating session sometimes encounters this problem: Warning: session_start () [function.session-start]...

System environment: WIN2003+IIS6+PHP5.2.12

PHP has an error similar to the following:

Warning: session_start () [function.session-start]:. Failed: No such file or directory. Wait for the situation

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

If the problem persists after restarting IIS

That is, the session variable requires temporary file space for the system and read and write permissions.

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

For example: session.save_path = "c:\ php5\ session_temp" and add permissions for this folder to give everyone permission to modify writes.

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:

The copy code is as follows:

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

Solution:

Method 1. Comment out / etc/php.ini

Session.save_path = "/ var/lib/php/session"

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

Method 3, do not have any output before session_start ()!

Then restart Apache

OK, problem solved!

At this point, the study of "PHP error WARNING: how to solve SESSION_START ()" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Errors files methods problems learning folders permissions code more environment users systems help practical effective and then information methods variables that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS Shulou Information Linux Redmi