Page 1 of 1
tmp folder permissions
Posted: Wed Sep 20, 2006 1:40 pm
by outdoorxtreme1
The other day I tried to go to my website and the following message appeared:
The following directories must be writable by the web server:
tmp/cache
tmp/templates_c
Please correct by executing:
chmod 777 tmp/cache
chmod 777 tmp/templates_c
or the equivilent for your platform before continuing.
The server host that I have my website on told me that they apologize for the inconvenience, but due to the recent attacks on the server they cannot allow folders to have their permissions set to 777. Also that if I wish to upload/write to these folders I can change the permissions on these folders to 777 via Cpanel's File Manager, but that these changes will be reversed every 6 hours.
They wanted me to contact the designers of CMS and ask them if they can make any changes so that the script does not require 777 permissions on folders.
Can someone please help me with this. I have 3 websites that are going to go down because of this issue.
Re: tmp folder permissions
Posted: Wed Sep 20, 2006 2:38 pm
by tsw
777 isnt a must.
if php is run with user rights 700 is a working solution
if you can chown tmp to apache (if php is run with apache rights which isnt nice imho) 700 is a working solution
if web server can write to those directories any permissions will work. 777 is a good starting point and works well on most installations
Hope this helps
Re: tmp folder permissions
Posted: Wed Sep 20, 2006 2:49 pm
by outdoorxtreme1
I changed the permissions to 700 using Cpanel and it still is not working. Did I do the right thing?
Re: tmp folder permissions
Posted: Wed Sep 20, 2006 3:12 pm
by tsw
It depends on how php and apache are set up.
php can be run with user permissions or apache permissions or (maybe Im not 100% confident) nobody rights depending on how its set
You should check (or ask) how php is set and then do a decision on the permission for tmp folders.
IMHO running php with apache rights is always a security problem and changing some folders to 777 doesnt really do any harm in that situation...
Re: tmp folder permissions
Posted: Wed Sep 20, 2006 3:48 pm
by outdoorxtreme1
Here is what web host told me:
On our server PHP is running with Apache rights. So the folder does need the 777 permissions. Currently we cant switch to running PHP with user rights as this will cause a lot of the PHP scripts on the server to fail. So please ask the coder to see if there is way to run the script with PHP running with Apache rights, but with no 777 folders.
What do I do?
Re: tmp folder permissions
Posted: Wed Sep 20, 2006 4:38 pm
by tsw
chown the folder for apache (you cant do it as you dont have permissions to do it but you can ask your hosting company to do it) after that you dont have any rights to that folder...
atm, I cant give any better advice.. maybe someone else can
Re: tmp folder permissions
Posted: Wed Sep 20, 2006 5:48 pm
by outdoorxtreme1
Here is the responce I got from the hosting company after I told them to try this:
I am sorry, but can not allow 777 Folders on the server. 777 Folders have universal permission for ANYONE to read, write (upload) and execute on the server. This has been the cause of numerous exploits over the past few months and we simply can not accept this any longer.
I hope someone can help me I have 3 websites hosted with this company that all of them use CMS. I don't want to have to go through the headache of transferring my sites to another company.
Re: tmp folder permissions
Posted: Wed Sep 20, 2006 7:14 pm
by tsw
If those folders are chowned to user which runs the apache process there is no need to have 777 as permissions. Only thing necessary for cmsms is to have write permissions to tmp for php process.
if those folders are owned by apache process 700 will be enough (apache has all permissions and everyone else none) (although it wont do them any good as anyone with access to the server can write a script that accesses those files but thats another thing)
Sorry if I'm unable explain this as clearly as possible.
Re: tmp folder permissions
Posted: Thu Sep 21, 2006 1:19 pm
by outdoorxtreme1
Well, I guess I am going to have to change server providers.

Here is what they told me:
The end result would be the same ...giving nobody permissions to a folder (which is what this is suggesting) is also allowing for server abuse through those files and settings and is not something we can do.
Anyone know of a good cheap web host? I currently have 333Mb with 20GB a month bandwidth. I don't need any more than this.
Re: tmp folder permissions
Posted: Thu Sep 21, 2006 4:49 pm
by tsw
sorry to hear that the hosting company is not even trying :/
there is a thread in this forum which has some suggestions. I host my own so cant really say anything
