Jump to content

[SOLVED] Wierd Session warning


nitation

Recommended Posts

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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.