Localhost permissions
-
If I install wordpress using no software other than the apache and php what groups will have access to the localsite ? Is there a terminal command that shows me ?
I can see that my install for example is
drwxr-xr-x@ 6 myname staff 204 22 Jun 08:18 wp-contentSo I don’t understand why wordpress cannot upload to its own directory (not yet created) but wordpress can create this directory if it can upload I assume…
Please don’t answer with the 777 stuff that is all unsafe and not helpful we all need to start to understand this stuff better.
-
Hi landed,
First you’ll want to check what user/group apache is running as. It can differ based on your distribution. For example, in RHEL/CentOS you can edit this in /etc/httpd/conf/httpd.conf – there’s a user and group setting pretty early on in the configuration file. Lets say they’re both set to Apache.
For this, you’ll want to set Apache as the owner, and your SFTP user group as the group, then set folder permissions to 775 and file permissions to 664 (folders need execute permissions to display during browsing while files do not). Here’s our article on it for examples. If you don’t require a SFTP user/group due to it being localhost (likely with shared folders on a virtual machine), you can use 755 and 644.
To answer the original question, the reason it can’t upload to its own directory is because Apache is likely running as a user that is different than the one you’re using to upload files – so it doesn’t necessarily have permissions.
If you have any more questions, just let me know!
Interesting I found this file thus etc/apache2/httpd.conf
and I had edited some older versions back when following some tutorial to set up a localhost on a mac…it had this#User _www
#Group _www
User myname
Group wheelSo I am going to see what this does I am thinking mac updates may change this file each time.
I think that fixed it thank you – maybe it was a mac update but now I know to look here each time I get funny errors.
Restarting apache btwapachectl restartfor anyone else here and thanks to zero for the advice 🙂
The topic ‘Localhost permissions’ is closed to new replies.