cancel
Showing results for 
Search instead for 
Did you mean: 

PHP session_start errors

N/A

PHP session_start errors

I keep getting the following error on occasions

Warning: session_start(): open(/tmp/sess_789b9c96bc130e8a56a5c2a8ef7b3a88, O_RDWR) failed: Permission denied (13) in /files/home2/cankita/index1.php on line 6

Most of the time the site runs smoothly but on some days I get the above error (which then gives further errors). How can it run okay on some days and not others? That indicates to me that it is F9 and not my code that is at fault.

Anyone got an answer. Is it something to do with the tmp directory?

Have to say I am rapidly becoming disillusioned with F9.

Les Ellingham
5 REPLIES
N/A

PHP session_start errors

/tmp seems to be goign AWOL ATM, but isn't meant to be relied upon.

The easiest option is to create a folder in your home folder called tmp then before session_start() calls put the following line:


session_save_path("/files/home2/cankita/tmp");


which will store sessions in your home folder instead - which means that it should work all the time.
N/A

PHP session_start errors

so we arent supposed to rely on the setup of a pretty damn essential php command? great!

any others we should know about? echo for example?

But serisously what other commands can we not rely on the setup of and have to manually configure what should already be set up to work properly in the php.ini ?

P.S. i'm not having a go at you csogilvie, thanks for the workaround.
N/A

PHP session_start errors

From http://portal.f9.net.uk/support/webspace/cgi/cgi_guide_new.shtml
Quote
6. Temporary Storage
Temporary (/tmp) storage will remain available, however, we we do not encourage using it if at all possible. We cannot guarantee the security of any data held within /tmp , nor can we guarantee the data won't be periodically cleared without warning. It is much better to get your scripts to write to a temporary directory within the security of your own homedirectory.
N/A

PHP session_start errors

I know that full well, but I would have expected someone to set it up so people didnt have to go back to all their scripts and add a line to get it running reliably when it should be something thats sorted in set up.

I take it by your response that you dont think it should have been setup so such a fundemental command would work reliably without any special setup? All the tutorials I have been through for PHP have never mentioned anything about reconfiguring where session data is stored, I wonder why that is? Probably because its expected to be set up to work.

I dont have the time to revisit all my scripts.
N/A

PHP session_start errors

The problem is that there is no way to have it set to the individual users folder directly - it has to use a publicly accessible one, which of course means people can delete it I guess. Although, from a quick inspection they are all only group read/write anyway.