Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: session_start() failed: No such file or directory

I'm trying to install berta (v 0.6.3b) and I get this error:

Warning: session_start() [function.session-start]: open(/var/php_sessions/sess_a0d6b8422181739d10066fb60cebfe5d, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb/web010/b100/ipg.ellieniemeyercom/engine/_classes/class.bertasecurity.php

on line 75 The error seems to happen on line 75 of class.bertasecurity.php (view source code)

What is wrong and how can I fix it?

like image 680
Mohammad Avatar asked Jul 16 '10 07:07

Mohammad


People also ask

What is the purpose of session_start () in PHP?

session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie. When session_start() is called or when a session auto starts, PHP will call the open and read session save handlers.

Where should I put session_start?

You want to put session_start(); at the top of your page before any other code. However, if you are using includes to make your life easier, it's best to put it at the very top of a file that is included in all files.


4 Answers

If you're changing the path that is being used for sessions.

You also might consider, fixing this problem by changing session.save_path variable in your php.ini file.

Then you'll be fixing in your configuration file and not only in your script.

like image 69
Daniel M. Melo Avatar answered Oct 23 '22 00:10

Daniel M. Melo


I think the folder containing the session data cannot be accessed by the PHP process.

If you have not touched your php.ini, the default session.save_handler should be files (which means that session data will be stored in a folder on your file system). The value of session.save_path contains that folder, you should check that it exists and its permissions for your php process.

like image 41
soulmerge Avatar answered Oct 22 '22 23:10

soulmerge


Make sure that session directory is writable or you can set a path yourself with:

session_save_path

This comment is also useful if you are using above function.

like image 41
Sarfraz Avatar answered Oct 23 '22 00:10

Sarfraz


Sessions are saved on the harddisk of your server. Most likely your session save path does not exist. Try setting it to a directory that does exist or that you have read/write rights to.

like image 1
Tjirp Avatar answered Oct 22 '22 23:10

Tjirp