nitation Posted October 7, 2008 Share Posted October 7, 2008 I have a running website for more than 5 months. While i was going through it today, i got this error, Warning: session_start() [function.session-start]: open(/tmp/sess_3b250c12e288b8b910f991f5af109ac0, O_RDWR) failed: Read-only file system (30) in /home/daltexncr/public_html/session.php on line 2 This is what i have in session.php <?php session_start(); $afso_name=session_name(); $afso_sid=session_id(); $afso_usid=$_SESSION["afso_userid"]; ?> Thanks Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 There seems to be a problem with your file rights, it seems you can no longer write temporary files. You may need to contact your host. At least this is what i think Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 7, 2008 Share Posted October 7, 2008 Not a PHP problem. Somehow the disk where the /tmp folder is located has been mounted as read-only. Contact your hosting company. Ken Quote Link to comment Share on other sites More sharing options...
nitation Posted October 7, 2008 Author Share Posted October 7, 2008 @ Ken, Still on the same shared hosting server, i uploaded the same script and i can't get the error. Quote Link to comment Share on other sites More sharing options...
nitation Posted October 7, 2008 Author Share Posted October 7, 2008 the error still shows. All session handling pages. When i try to access a secure page, it will ignore the authentication (Username||password) Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 Did you listen to what Ken and I said? Quote Link to comment Share on other sites More sharing options...
nitation Posted October 7, 2008 Author Share Posted October 7, 2008 I did contacted them, and the company said there is no problem from there side. I don't know what to do. Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 Give them a link to the page, they must have some sort of technical support who will then look at it properly. Quote Link to comment Share on other sites More sharing options...
revraz Posted October 7, 2008 Share Posted October 7, 2008 One thing you can do is point your session to a new save path that you know you can write to. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted October 7, 2008 Share Posted October 7, 2008 Which host do you use? Quote Link to comment Share on other sites More sharing options...
nitation Posted October 7, 2008 Author Share Posted October 7, 2008 @dark water am using a shared hosting from www.sahostplus.com php 5.2.5 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 7, 2008 Share Posted October 7, 2008 Searching the Internet shows that a very very large number of web sites have the error, but I did not find anything that was an actual discussion that solved it. I could not find anything in the php manual or the php bug reports. Either the disk is full or the folder has the maximum number of files in it or the folder has reached its' storage quota limit (and the session data file cannot be created) or there is a user/owner/permission problem or the file is locked and is read only because your page has multiple references to the same session file, such as would happen if you are using iframes or dynamically generated images that reference the same session the main page is using. This last one is the most likely cause. Does that sound like what your site could be doing? Quote Link to comment Share on other sites More sharing options...
nitation Posted October 7, 2008 Author Share Posted October 7, 2008 @PFM according to this, if you are using iframes or dynamically generated images that reference the same session the main page is using I am not doing anything relating to that, also, the file "session.php" is located in the public_html directory of the hosting. I included it on all the pages that i want session to be established. It's getting me worked out. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 7, 2008 Share Posted October 7, 2008 What browser are you using? And have you tried this in different browsers (FF and IE?) FF can request a page twice simply due to the stupid way it applies default character encoding. If a page uses sessions, that would result in two page requests using the same session, which could result in the posted error. Quote Link to comment Share on other sites More sharing options...
nitation Posted October 7, 2008 Author Share Posted October 7, 2008 I tried it on FF, IE and GC(Google Chrome). All bringing the exact error. Any other suggestion(s)? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 7, 2008 Share Posted October 7, 2008 Using any mod rewrite rules (that could cause a page to be requested twice?) Because there was a huge number of sites that showed up in the web search with that same error being output, this is something frequently occurring. So, it is either something the browser (or search engine) is doing when it visits the site or it is something the server/php is doing. One possibility is if your page has a fatal runtime error, the cleanup code that should be executed to release/close session files might not be executing (there was a bug in php 5.2.3 or .4 where they did not flush output buffering on a fatal error.) This would result in the next page visit using that session data file to be greeted with a locked file. What type of things does your web server error log file show right before that error? Quote Link to comment Share on other sites More sharing options...
nitation Posted October 7, 2008 Author Share Posted October 7, 2008 Nothing relating to the error i posted. Also, i haven't checked the error log in a month or so. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 7, 2008 Share Posted October 7, 2008 Are there any other php generated errors, including any in the "view source" of the page? Quote Link to comment Share on other sites More sharing options...
nitation Posted October 8, 2008 Author Share Posted October 8, 2008 Yes i do. The below error is displayed on the page together. Warning: session_start() [function.session-start]: open(/tmp/sess_da6ebfaed4c2e51cc8d0f61145dca385, O_RDWR) failed: Read-only file system (30) in /home/prudccou/public_html/session.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/prudccou/public_html/session.php:2) in /home/prudccou/public_html/session.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/prudccou/public_html/session.php:2) in /home/prudccou/public_html/session.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /home/prudccou/public_html/session.php:2) in /home/prudccou/public_html/login.php on line 8 Quote Link to comment Share on other sites More sharing options...
sKunKbad Posted October 8, 2008 Share Posted October 8, 2008 Maybe you can try putting all of your session scripting in an include, and then include_once(); on each page that needs sessions. If the session scripting can only be included once, this may take care of the problem. Quote Link to comment Share on other sites More sharing options...
R0bb0b Posted October 8, 2008 Share Posted October 8, 2008 quick fix, put this line above session_start(); ini_set("session.save_path","/some/directory/you/can/access"); This will band aid until you have the real solution. Quote Link to comment Share on other sites More sharing options...
nitation Posted October 8, 2008 Author Share Posted October 8, 2008 I tried that, This is the output Parse error: syntax error, unexpected T_STRING in /home/prudou/public_html/session.php on line 3 Quote Link to comment Share on other sites More sharing options...
R0bb0b Posted October 8, 2008 Share Posted October 8, 2008 I was sure that was the right syntax. You can use this function, which also needs to be called before session_start(); session_save_path("/some/path/to/dir/"); Quote Link to comment Share on other sites More sharing options...
nitation Posted October 8, 2008 Author Share Posted October 8, 2008 Please look into this, session_save_path("/some/path/to/dir/"); This ("/some/path/to/dir/"), should i leave it this way, or i must specify some path to a directory and if yes, what directory? I hope you understand Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 8, 2008 Share Posted October 8, 2008 The other errors in post #18 are a side-effect of the first error. Though I am starting to wonder what else might be going on. Add the following two lines immediately after your first <?php tag in the main script file - ini_set ("display_errors", "1"); error_reporting(E_ALL); Is login.php the main file or is that being included by some other file? Post lines 1-8 of login.php as well. For your latest error, the only way anyone one would be able to help you with a syntax error in your code is if you posted your code. Post lines 1-3 of session.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.