/tmp file filling up and causing scripts to fail
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- /tmp file filling up and causing scripts to fail
/tmp file filling up and causing scripts to fail
30-01-2011 9:03 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
My ccgi website is currently displaying warning messages top and bottom about the tmp file, e.g:
"Warning: session_start() [function.session-start]: open(/tmp/sess_65a65ca1a5937199859b10f39dcc1714, O_RDWR) failed: File too large (27)"
"Warning: Unknown: open(/tmp/sess_65a65ca1a5937199859b10f39dcc1714, O_RDWR) failed: File too large (27) in Unknown on line 0"
I currently have a ticket raised with PN that goes back to Christmas when it started, at which time PN said: "We have become aware of an issue on another of our user's CGI space, which was causing the tmp file to fill up. This resulted in scripts failing, and we apologise for the inconvenience. However we have now taken action such that the problem should not recurr." Unfortunately the problem did recur and keeps on recurring and evidently the 'fix' (if one was produced) hasn't worked.

If that wasn't bad enough, the problem actually goes back years. In 2007

Am I being unreasonable to expect PN to have fixed the problem after 4 years? Is it really that insoluble?
If anyone got any suggestions, pleeeeeeeeeeease let PN know cos it's driving me mad. Thanks.
Re: /tmp file filling up and causing scripts to fail
30-01-2011 11:48 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Just configure a local php.ini file to use your own home folder or a folder within your home folder as temp storage. See http://community.plus.net/forum/index.php/topic,83568.msg696223.html#msg696223 - note: I don't think you need the full file, only a php.ini containing the parameters you want to change.
Re: /tmp file filling up and causing scripts to fail
31-01-2011 5:49 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Peter note: I don't think you need the full file, only a php.ini containing the parameters you want to change.
Unlike ini_set, a local php.ini file completely replaces the master php.ini file. Any values not set will revert to the php default values rather than the master settings. This may lead to unintended results.
Incidentally, it's also a good idea to set session.gc_probability = 1
Gabe
Re: /tmp file filling up and causing scripts to fail
31-01-2011 5:52 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator

Re: /tmp file filling up and causing scripts to fail
11-03-2011 2:52 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have purchased a program (TNG8) which allows me to put my family tree on the web and all works fine for a few days - then the errors appear, generally for a day or two. Then they disappear and the site is once again useable - until the next time. As I bought a ready made package, my experience of php and webspace is very limited.
PN tells me “ …the /tmp global shared folder fills up ….and we suggest you alter your code so it uses your own local space to act as the temp directory for your site rather than using the shared directory.” They also say they have a cron job to purge the file which I guess is why it clears and reappears - however this is obviously not a useful solution.
My problem is that I do not understand how to alter the code.
Also, if I make a php.ini of my own (as I do not see one anywhere at present), where does it need to go?
Do I need all the file referred to at http://community.plus.net....msg696223.html#msg696223 ?
I hope someone may be able to help - but keep it simple , please.
Re: /tmp file filling up and causing scripts to fail
11-03-2011 11:24 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
If you save the following script with a .cgi extension (e.g. phpini.cgi), upload it to your web root folder as ascii, set permissions to 700, and call it in a browser, it should create a tmp folder and a php.ini file for you and add the appropriate lines to the php.ini and put symlinks to the php.ini in all folders containing .php scripts.
#!/bin/bash
echo "Content-type: text/html"
echo
mkdir tmp && chmod 710 tmp
cp /etc/php5/cgi/php.ini ~ && chmod 600 php.ini
if [ -e php.ini ]
then
cat >> php.ini <<EOF
; Override section
display_errors = Off
expose_php = Off
register_globals = Off
upload_tmp_dir = $(pwd)/tmp
session.save_path = $(pwd)/tmp
session.use_only_cookies = 1
session.gc_probability = 1
soap.wsdl_cache_dir="$(pwd)/tmp"
EOF
for file in $(find . -mindepth 1 -type d -print0 | xargs -0)
do
[[ $(ls "$file") =~ \.php ]] && ln -s "$(pwd)/php.ini" "$file/php.ini" && echo "$file/php.ini<br>"
done
fi
More settings can be added above the second EOF, if desired.
Gabe
Re: /tmp file filling up and causing scripts to fail
12-03-2011 9:47 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Many thanks for the prompt reply.
I am unable to deal with this now until Monday but I will get back to you then.
Thanks again
Re: /tmp file filling up and causing scripts to fail
14-03-2011 10:54 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
That seems to have done the job.
Opening the .cgi in the browser resulted in a string of entries such as
./admin/pnp.ini
./templates/template1/php.ini
etc
On examination, these folders each now have links to php.ini
There is a new tmp folder in my web root folder along with a php.ini file (which looks like the one listed in the previous post).
The web site appears to work just fine and time will tell if this has resolved the original problem.
I cannot thank you enough for your help. I certainly could not have done this myself.
I will now get on with uploading more data to the site now I have the confidence that it will work OK.
Thanks once again.
Nigel
Re: /tmp file filling up and causing scripts to fail
22-04-2011 10:02 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator

However, my newly created tmp folder is empty. Is that what you would expect?
@Nigel - interested to see that your problem was in connection with TNG, which has been my problem too! I contacted DL about it and he recommended that I "just need to set the
session.save_path variable to a writeable folder on your site". Unfortunately he didn't explain how exactly to do that, and I didn't feel I could press him for more help.
Chris
Re: /tmp file filling up and causing scripts to fail
22-04-2011 4:50 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Just to let you know that all has been well with my TNG site over the past 6 weeks or so since following Gabe's suggestion.
My tmp folder has a number of session ID's in it (I think these are kept for about a week).
At least you got a reply from TNG, my post to their forum only got one response and that was from someone else with the same problem!
Nigel
Re: /tmp file filling up and causing scripts to fail
02-05-2011 6:43 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Gabe Trying to simplify things:
If you save the following script with a .cgi extension (e.g. phpini.cgi), upload it to your web root folder as ascii, set permissions to 700, and call it in a browser, it should create a tmp folder and a php.ini file for you and add the appropriate lines to the php.ini and put symlinks to the php.ini in all folders containing .php scripts.
Gabe
Gabe
I tried this, wrote the file as ascii and uploaded to my root. Wh=ent into my browser and attempted to open, but all I got was '403 forbidden'.
Nothing appeared in my directories. I have two sites hosted in my webspace.
Should this be in the root of each subdirectory or in the main root?
Re: /tmp file filling up and causing scripts to fail
02-05-2011 7:37 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Note: your cgi webroot is '/', and you've only the one. You mentioned hosting two sites - are these are in separate subdirectories with a .htaccess file in / to direct browsers to the appropriate subdirectory? That .htaccess file needs permissions 640 which you will need to set using your FTP program (though 640 might be the default).
Make sure you upload the cgi scripts (and .htaccess) in ASCII transfer mode. Just a single copy of phpini.cgi needs to be run, and that needs to go into /. The uploaded cgi scripts must have their permissions set to 700.
David
Re: /tmp file filling up and causing scripts to fail
24-05-2011 8:59 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thank you very much for your script. It worked a dream on my site.
I would have been pulling my hair out if I had not come across it.
Just need to sort out some coding issues I have and everything will be fine.
s
Re: /tmp file filling up and causing scripts to fail
07-06-2011 9:23 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I ran into the same problem and tried the script, but I ran into a server error:
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: phpini.cgi
If you think this is a server error, please contact the webmaster.
Error 500
Any ideas? Please?
Jon
Re: /tmp file filling up and causing scripts to fail
08-06-2011 12:31 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- /tmp file filling up and causing scripts to fail