Is it right to use chmod 777 when this is the only option?

gabrielvbauer

New Member
Credits
16
Firstly good morning. I am a recent user of ubuntu, it must have been about two months that I use it, anyway, I started a WordPress course and in it we used xampp to not need to buy a direct host, however the problem is that WP cannot create new files, either when I download a new theme or plugin, it always gives the same permission error. I've tried to leave it as 755/644, 775, 664 and nothing, the only one that worked was 777, which is bad for security. I was wondering if it is good to leave it as 777 even if that is the last option.
And when I upload to the server via ftp, will it inherit those permissions? or will I be able to change them to 755/644 and everything will run correctly?

 


captain-sensible

Well-Known Member
Credits
5,792
so you are talking about playing with wordpress on localhost not live hosting i hope. mostly with wordpress you will just be left mouse clicking. Its even worse if you are actually editing code say a php class or one its methods. chmod codes are:
4 read
2 write
1 execute

So if i want to edit and save it i need a permission of at least 6; code that needs to enter a directory needs 7. But the questions on editing is - who am I and who owns the stuff and which group ?

if you have permission of 777 the last 7 means basically any "Tom ,Dick or harry " who is not the owner, nor even belong to the group and read, read and execute.


I did use xampp for local dev but these days use I apache for local dev . i find its clearer who owns what.

owner : apache
group : apache

you will see stuff on the web; that mention one way to circument around things is to add yourself "as an account holder" to the group apache. I have WorPress running on apache at the moment and to keep things simple i'm using an sqlite3 plugin. Basically on local dev you want things to run as they should but you also want to be able to go directly into the dev folder at /var/www/htdocs and directly edit.

I'm not sure if i'm ok to post a url here which will take you away from this site ; but i did recently have an intro article published on phpocean.com or maybe you google it .
Its called Web development on GNU/Linux.
 



Latest posts

Top