Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Public Write Permission on app/_cache

18 Nov 2014, 20:41

Do you think it is dangerous to grant public write access to a folder that is available over the web app/_cache?

The folks who host my server have major reservations.

Please advise
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: Public Write Permission on app/_cache

18 Nov 2014, 23:43

alexhenes wrote:Do you think it is dangerous to grant public write access to a folder that is available over the web app/_cache?
Interesting question!

It's not really "public" write access ... It just means that all "owners" of files under your website are allowed to write to that folder. If your server is setup correctly, there isn't any reason why there should be unknown "owners" under your website at all.

The main problem, is that many hosts assign one user for FTP uploads, and then the application PHP script becomes a separate user. Therefore, in order for the PHP script to write to a folder that has been created by FTP, you would need to set write permissions also for "others" (chmod 777):
Image

If your server is setup in a modern smart way (like our hosting at mediatemple), they have understood that that the FTP user should be the same user as the script that was uploaded by the FTP user. In these cases, you can set write permissions for only the "owner" (chmod 755) of the script. Often, you would not even have to set permissions in the first place, because 755 would be default.
Image

If I was you, I would go ahead and try the above! X3 checks if the cache folder iswriteable when opening a page, so if it doesn't work, you will get a notification message instead of seeing the website. If it does work, your website will "just work" like before. Good for you! Bravo to your host!
alexhenes wrote:The folks who host my server have major reservations.
I may be a bit judgmental here, but these server folks often know stuff like the above, yet they do not take this into account when making functional hosting. Try the above, and if chmod 755 works for you, then applause to your hosting. If 755 does not work, then I would like to ask your host how they can have reservations about chmod 777 if that is the only way for an application script to write data to a folder?
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: Public Write Permission on app/_cache

19 Nov 2014, 00:07

Thanks... I set things back to 775 and everything seems to be working.
Last edited by alexhenes on 19 Nov 2014, 00:43, edited 1 time in total.
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: Public Write Permission on app/_cache

19 Nov 2014, 00:37

alexhenes wrote:Thanks... I set things back to 755 and everything seems to be working.
Good! I will add some more docs on this, and perhaps better diagnostics ...
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: Public Write Permission on app/_cache

19 Nov 2014, 00:44

oops... typo... everything is set to 775
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: Public Write Permission on app/_cache

19 Nov 2014, 00:58

alexhenes wrote:oops... typo... everything is set to 775
Didn't work with 755?
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: Public Write Permission on app/_cache

19 Nov 2014, 01:23

Didn't try 755... My server was originally setup with 775
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: Public Write Permission on app/_cache

19 Nov 2014, 05:05

Sorry, I deleted my last msg as it was technically incorrect.
Chmod 775 could definitely be considered safer than 777.