Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: KenX on June 08, 2012, 06:41:55 AM

Title: Need Help!cache directory is not writable
Post by: KenX on June 08, 2012, 06:41:55 AM
I am getting this error
Performance Warning
The cache directory is not writable - this will adversely affect the performance of your forum.


How can I solve this problem? ???
I am using SMF 2.0.2
Title: Re: Need Help!cache directory is not writable
Post by: Storman™ on June 08, 2012, 06:50:29 AM
Sounds like the chmod settings on that folder (cache) are set incorrectly.

CHMOD - What's that all about ? (http://wiki.simplemachines.org/smf/CHMOD_-_What%27s_that_all_about)

It's probably set to 755 or less. Try changing to 775 initially
Title: Re: Need Help!cache directory is not writable
Post by: MrPhil on June 08, 2012, 09:23:58 AM
PHP needs to be able to write to the directory. If 755 doesn't work, try adding "write" privileges to the permissions until they work. 775 might do it, and is fairly safe, but I would be leery of using 777 (anyone sharing your server can overwrite your cache). See my sig > FAQs > Proper Permissions.

You should experience the same "not writable" problems with your attachments and avatars directories, and packages (if you choose to install a mod). Frankly, the SMF cache system has never worked very well and is the source of many problems (requiring that the cache be emptied out). I would suggest simply disabling the SMF cache if you can't get it to work well and consistently with reasonable permissions. You won't really lose much.
Title: Re: Need Help!cache directory is not writable
Post by: KenX on June 10, 2012, 06:11:43 AM
Thanks changed it to 777 and it worked.But I know it's dangerous to keep it to 777.Why is it not writable with 755 or 775?
Title: Re: Need Help!cache directory is not writable
Post by: Storman™ on June 10, 2012, 06:28:49 AM
QuoteThanks changed it to 777 and it worked.But I know it's dangerous to keep it to 777.Why is it not writable with 755 or 775?

Lots of info in this topic:

Why chmod 777 is NOT a security risk (http://www.simplemachines.org/community/index.php?topic=2987.0)

It's a contentious and debatable issue, read the replies though as there are instances when it could be a potential risk.

If it worries you simply turn off the cache, it may well work ok without it.
Title: Re: Need Help!cache directory is not writable
Post by: MrPhil on June 10, 2012, 09:17:41 AM
Quote from: KenX on June 10, 2012, 06:11:43 AM
Thanks changed it to 777 and it worked.But I know it's dangerous to keep it to 777.Why is it not writable with 755 or 775?

If your server is set up such that PHP is running as a random user ID, its permissions will fall under "other" or "world". That's the third number in the permissions. I don't like hosts that set up that way, but that's life.

Contrary to what some will tell you, 777 is often a security hazard on a shared server. Even if no one can get in through the Web interface, other users sharing your server may be able to get to your directories. That's why you should avoid 777 unless there's absolutely no other choice, and even then, revert to 755 when the operation (such as a mod installation) is completed, if possible.