Error on session_start()
Moderator: General Moderators
Error on session_start()
All of a sudden I get this error on two of my sites when the line session_start(); is executed. It only happens in Mozilla Firebird, and it only happens occaisionally. There are other errors, but I think they are the usual 'Cannot send header' that get caused by the first error being output.
Warning: open(/tmp/sess_e08e8735faff7d341bf2eb3d2124210d, O_RDWR) failed: Permission denied (13) in <my webroot>/loginscript.php on line 36
What's going on? It's all worked fine up till now.....
Warning: open(/tmp/sess_e08e8735faff7d341bf2eb3d2124210d, O_RDWR) failed: Permission denied (13) in <my webroot>/loginscript.php on line 36
What's going on? It's all worked fine up till now.....
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
to over come the issue'Cannot send header'
just use
but u hav to use in the start of the page i.e on the 1st line
Code: Select all
<?php
ob_start("mb_output_handler");
?>- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
itsmani1 - you have to be sure of the question before you answer. In this case it is not that there is a headers already sent error, but that permission is being denied when PHP attempts to write to the session file. Please take care to read questions carefully.
RFairey - I've not come across this myself but it seems strange that you would be denied permission sometimes and only when using a specific browser
. Have you searched for any relevant bugs on php.net (bugs.php.net)?
Mac
RFairey - I've not come across this myself but it seems strange that you would be denied permission sometimes and only when using a specific browser
Mac
If the script causing this (well, the script being run upon error shows) isn't to long, could you post it or put up the source on a public access server?
As it works sometimes, I hardly think there is an error in the script, but to get the bigger picture it could be nice.
Bump up the error levels, erase @function so that you do not supress error msg's that might appear before the one you posted in the original post. Meaning, if you supress the error from function A(), but A() is vital for function B()... well, it's like a house of cards.
As it works sometimes, I hardly think there is an error in the script, but to get the bigger picture it could be nice.
Bump up the error levels, erase @function so that you do not supress error msg's that might appear before the one you posted in the original post. Meaning, if you supress the error from function A(), but A() is vital for function B()... well, it's like a house of cards.
To qoute twigletmac "You have to be sure of the question before you answer. In this case it is not that there is a headers already sent error, but that permission is being denied when PHP attempts to write to the session file. Please take care to read questions [EDIT: and replies] carefully."bigwreck wrote:are your permissions set properly ? Is this running on windows ? UNIX ? it looks like you dont have permissions to write to /tmp ... if this is running on windows you'll have to change your php.ini file to reflect this ie C:\temp or whatever
Ah - I think I know whats happening - what happens if I do a session_start on one site, then hit another session start on another site before calling session_destroy on the first one? Thats what I reckon is happening (both sites are on the same server). Is there a way to ensure no other session is in progress before starting a new one?
To be honest I don't think that would be the problem (unless your server is really screwed up). Every user that visits your website will start a new session and each session gets a unique ID as you probably know. You will have your own session data when you browse this Forum for example, and if you open up another Browser window and go to another site the chances are you will start a session there as well.
It might be worth looking into it just to make sure but as I said I doubt that's the problem.... I certainly haven't had any trouble with multi-sessions on my home server.
It might be worth looking into it just to make sure but as I said I doubt that's the problem.... I certainly haven't had any trouble with multi-sessions on my home server.