Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PHP error WARNING: how to solve SESSION_START ()

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report