Home >Backend Development >PHP Tutorial >How to solve Fatal error session_start() error in PHP
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存储路径 }
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!