Apache - Permissions are missing on a component of the path

你离开我真会死。 提交于 2019-12-03 06:21:25

I finally found it! Thanks a ton Justin lurman to poiting out the .htaccess file. It made me see that Wordpress didn't have the right to edit my .htaccess file anymore. That was even more weird because I was 100% sure that permissions were good (even way too permissive if you ask me).

So I looked into SElinux, as I know it can play tricks on me at times and I was right. Issuing the following command solved it :

chcon -R --type=httpd_sys_rw_content_t wp-content/

I hope that helps someone else :)

In my case the containing folder did not have the +x permission, changing it to 755 did the trick.

Or you can run

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

In those folders...

On macOS it might be caused by a user group permission issue.

Go to httpd.conf file (located at /usr/local/etc/httpd if Apache is installed by Homebrew). Find <IfModule unixd_module> and change the value in front of User to your computer username (that you log in with). Restart Apache.

This needs to be done to PHP-FMP as well if you are using that with Apache. Find php-fpm.conf file (usually located at /usr/local/etc/php/7.x/ and find the pool definitions:

uncomment include=/usr/local/etc/php/7.x/php-fpm.d/*.conf if commented and save the file. now open the recently uncommented file and find user = and change the value of user to your computer username. Now restart PHP service.

setsebool -P httpd_enable_homedirs 1

chcon -R -t httpd_sys_content_t /home/user/public_html

What worked for me was that all component directories in the path needed execute permissions for all

so if the path of the website is /home/user1/public_html/docroot

chmod +x /home/user1/
chmod +x /home/user1/public_html/
chmod +x /home/user1/public_html/docroot/
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!