13

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?

HPierce
  • 7,249
  • 7
  • 33
  • 49
Mohammad
  • 7,344
  • 15
  • 48
  • 76

5 Answers5

17

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.

Sarfraz
  • 377,238
  • 77
  • 533
  • 578
  • thank you, could you provide more detailed code on how that would be set to an example directory? – Mohammad Jul 16 '10 at 07:26
  • @Mohammad: You can visit the link i have provided for comprehensive docs and more useful comments by different people :) – Sarfraz Jul 16 '10 at 07:28
3

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.

soulmerge
  • 73,842
  • 19
  • 118
  • 155
  • would something like `echo session.save_path;` do it? – Mohammad Jul 16 '10 at 07:29
  • These are ini-values (configuration values for the PHP process) You can modify them using `ini_set()`. Have a look at the official explanation (and the links I provided in the answer): http://de.php.net/manual/en/configuration.changes.modes.php – soulmerge Jul 16 '10 at 07:37
  • i just checked and the value for `session_save_path()` is `/var/php_sessions/` – Mohammad Jul 16 '10 at 08:08
  • so i suppose i don't have write permissions in that folder. – Mohammad Jul 16 '10 at 08:09
3

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.

Daniel M. Melo
  • 118
  • 1
  • 6
1

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.

Tjirp
  • 2,435
  • 1
  • 25
  • 35
0

We encountered this problem when migrating a website from a cPanel server to a different host.

The session.save_path was configured in php.ini and .user.ini inside our public_html/ folder, and was presumably overwriting a default path the host would have wanted to use.

We decided the files were not needed at all, just a hangover from the old server, and deleted/renamed them out of the way, and this fixed the problem.

mwfearnley
  • 3,303
  • 2
  • 34
  • 35