How to solve Fatal error session_start() error in PHP

不言
Release: 2023-03-31 22:40:02
Original
1892 people have browsed it

This article mainly introduces the steps to solve the Fatal error session_start() error in PHP, focusing on the error elimination steps. If you check it step by step, you can definitely solve this error. Friends in need can refer to it

Error message:

Fatal error: session_start() [function.session-start]: Failed to initialize storage module: files (path: ) in C:\usr\phpMyAdmin\libraries\ session.inc.php on line 75

I. Change server configuration:

1. Check the error.log (Apache2.2\logs) file to see if there is error report. Not found.

2. Check whether the value of session.save_handler in php.ini is files. If not, change it to files

3. Check whether session.save_path in the php.ini file is commented. If so, remove the preceding ";".

4. Change the path after save_path to an existing path, such as "D:\php\temp"

5. Check whether the attributes of the temp folder are readable and writable.

6. Restart the APACHE server. OK

II.php Change the session storage path in the program

$sessSavePath = dirname(__FILE__).”/../cache/sessions/”;
if(is_writeable($sessSavePath) && is_readable($sessSavePath))
{
session_save_path($sessSavePath);//重点 改变session存储路径
}
Copy after login

The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please Follow PHP Chinese website!

Related recommendations:

About the implementation principle of Laravel queue and how to solve the problem

One about Laravel Route redirection Question

#How to quickly install the Laravel framework on a local virtual machine

The above is the detailed content of How to solve Fatal error session_start() error in PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template