cancel
Showing results for 
Search instead for 
Did you mean: 

Sessions Problem since CGI upgrade

Tonyr
Newbie
Posts: 8
Registered: ‎31-03-2010

Sessions Problem since CGI upgrade

session_start() problem
)My site has started to complain about the  session_start(); line.
The response is :-
Warning: session_start() [function.session-start]: open(/tmp/sess_f37d555f6fecc50c7369a84c5b1fc7a4, O_RDWR) failed: File too large (27) in /share/storage/04/st/strus/include/session.inc on line 12
This seems to indicate the session file is too large or the directory is full. What is the best way to overcome this. I have tried to use
ini_set ('session_save_path','/???????  to set the path to one in my directory without any luck.
19 REPLIES 19
ammonyte
Newbie
Posts: 7
Registered: ‎01-04-2010

Re: Sessions Problem since CGI upgrade

Yes I too have this problem. However it has only arisen within the last 48 hours. I cannot login to my Admin page. I am using Wordpress 2.9.x (well the latest version whatever the .x is up to now).
The error also appears at the top of the page at http://ccgi.ammonyte.plus.com/blog.
Astronut
Dabbler
Posts: 17
Thanks: 3
Registered: ‎31-01-2010

Re: Sessions Problem since CGI upgrade

I'm getting this too, as of last night, but only when using Internet Explorer 8.  Firefox is fine!  (I may be able to check other browsers later.)
There was a similar problem for a day or so a couple of weeks back.
Tonyr
Newbie
Posts: 8
Registered: ‎31-03-2010

Re: Sessions Problem since CGI upgrade

Plusnet support would not agree this was within their remit to fix!
The answer is to set your own sessions storage area
See my first few lines
ini_set ('session.name','tvmfc');
ini_set ('session.cookie_lifetime','3600');
ini_set ('session.gc_maxlifetime','3600');
ini_set ('session.gc_probability','1');
// ini_set ('session_save_path','/files/home3/strus/SESSIONS/');
session_save_path('/files/home3/strus/SESSIONS/');                          *********This is the line to add*********
session_start();
To determine your path use phpinfo() and look towards the bottom of the output  for    _ENV["SCRIPT_FILENAME"]
make a directory to save the  session info in, I used SESSIONS and then include this in the path above. You will now see your session info grow and removed from this directory as time goes by with usage. The probability can be set higher to keep more info etc.
Astronut
Dabbler
Posts: 17
Thanks: 3
Registered: ‎31-01-2010

Re: Sessions Problem since CGI upgrade

Where are you putting this code?
Is it in your PHP.INI? Or in your application script? (I'm assuming this is PHP!)
Jon
Tonyr
Newbie
Posts: 8
Registered: ‎31-03-2010

Re: Sessions Problem since CGI upgrade

The code is php and if you have the problem then it will be caused by the sessions_start(); line. from my info above insert the one line above your sessions_start(); line having set up the directory and all should be well.
All the pages in my site that need this have it included because I include_once  the file "sessions.inc" at the tope of the php page. the commands then are in the include file which makes global changes easier.
Astronut
Dabbler
Posts: 17
Thanks: 3
Registered: ‎31-01-2010

Re: Sessions Problem since CGI upgrade

That certainly seems to have fixed it!  I'd already tried the php.ini approach but that didn't seem to work very well.
In my case, I've placed this in the main config file that my CMS uses.
Excellent work!  Thanks Smiley
Jon
aenea
Grafter
Posts: 31
Registered: ‎30-07-2007

Re: Sessions Problem since CGI upgrade

Hmm. I had the same problem with my site this morning. Didn't have time to look into it then and now the problem has gone away. So - there was definitely something happening on the CGi platform earlier today.
tonycollinet
Community Veteran
Posts: 1,135
Thanks: 5
Registered: ‎14-08-2007

Re: Sessions Problem since CGI upgrade

I'm still having the problem - see:
http://community.plus.net/forum/index.php/topic,84896.0.html

EDIT: How do I use phpinfo() to determine the path - is it something I run in the webbrowser? Or must I add the command to a php file (like Gabes permissions script)?
Thanks.
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: Sessions Problem since CGI upgrade

Quote from: collinet
EDIT: How do I use phpinfo() to determine the path - is it something I run in the webbrowser? Or must I add the command to a php file (like Gabes permissions script)?

Create a PHP file (eg called php_info.php) containing
<?php
phpinfo();
?>
Upload it to your ccgi site using FTP. Make it executable (chmod 0700) and call it in your browser.
David
David
tonycollinet
Community Veteran
Posts: 1,135
Thanks: 5
Registered: ‎14-08-2007

Re: Sessions Problem since CGI upgrade

Thanks - will give it a try.
ammonyte
Newbie
Posts: 7
Registered: ‎01-04-2010

Re: Sessions Problem since CGI upgrade

Quote from: ammonyte
Yes I too have this problem. However it has only arisen within the last 48 hours. I cannot login to my Admin page. I am using Wordpress 2.9.x (well the latest version whatever the .x is up to now).
The error also appears at the top of the page at http://ccgi.ammonyte.plus.com/blog.

OK I fixed my problem. It appears that the Wordpress Automatic Upgrade Plugin is incompatible with the settings that Plusnet are now using.  When I renamed the plugin folder, my blog displayed correctly and I was able to login to the Admin page.
SkySurfer
Dabbler
Posts: 15
Registered: ‎03-04-2010

Re: Sessions Problem since CGI upgrade

I am also getting this exact same error with an installation of PMOS Helpdesk wrapped inside a Joomla site.....All was well until yesterday  Sad
I posted a ticket into PN yesterday to ask what has changed now to cause the error that appears to be affecting the site (and various others apparently), but as yet have had no response.
Having read the posts from Tonyr, I have tried to understand and implement the idea of setting up my own sessions directory, but I am guessing I am a wee bit too thick to get it right and could do with some "fuzzy-felt" help from someone!  Embarrassed
The remainder of the site is working perfectly (Joomla/Virtuemart) - it is just the PMOS scripts that are falling over...
If anyone has any ideas or could point me in the right direction, it would be greatly appreciated Smiley
Tonyr
Newbie
Posts: 8
Registered: ‎31-03-2010

Re: Sessions Problem since CGI upgrade

Sorry for the long winded mail here.
It seems the problem is PN are messing with the /tmp directory or the PHP defaults.
To overcome this you can set up where your own sessions are stored and there a number of steps shown in short then expanded for more explanation.
1, in your web directory on the CGI server set up a new directoty (I called mine SESSIONS). CASE SENSITIVE.
2, Use phpinfo() to find your absolute path to your directory.
3, Add a line to your scripts to make use of the new directory.
First I hope since you have uploaded files etc to your site, that making a new directory is a simple matter. I use Dreamweaver but if you use ftp then open the site and issue the mkdir SESSIONS command to make the new directory.
Second upload a file into that directory, I called mine tonyinfo.php and had three lines.
<?php
phpinfo();
?>
//  make sure that the file has min 700 attributes
Second part to the second part is to use a web browser to go to your site /SESSIONS/tonyinfo.php
Look down the return page to near the bottom under sessions for the _ENV["SCRIPT_FILENAME"]. you will see the the path and the file name( /files/home3/strus/SESSIONS/tonyinfo.php).
Third is to add a line in your PHP code before the sessions.start(); line. The line to add is:- session_save_path('/files/home3/strus/SESSIONS/');   
now if you monitor the SESSIONS directory you will see files added and disappear. They are the session files that would have gone in the /tmp dir that is playing up on the server for whatever reason.
More importantly your problems should have stopped.
I hope this is enough for you SkySurfer but you may find me on skype from time to time tony_strus
SkySurfer
Dabbler
Posts: 15
Registered: ‎03-04-2010

Re: Sessions Problem since CGI upgrade

Tony - You are indeed a star !! Smiley
I knew it needed a Fuzzy Felt approach to get through to me...lol
Basically, I had made 2 errors when trying to follow your previous posts:-
1. I didn't realise the sessions directory would be CASE sensitive - I had the directory in lower case and the php mod in uppercase.
2. With the PMOS script, the line mod needed to be one line higher than directly above the "session_start();" line - In my particular case, I had "if( !headers_sent( ) )
" directly above the session_start, and your mod needed to go above that...... why that would be is beyond me I'm afraid !!
Anyway.....got there in the end with a little fiddling and all is well again Smiley
Thanks once again for the much needed help, and thanks for the very fast response.... I would have been seriously struggling without you.
Incidentally, the PN ticket has now been open 30 hours and still no response..... might as well close that me thinks !!