Apache - Permissions are missing on a component of the path

前端 未结 6 970
南笙
南笙 2021-02-08 11:03

None of my website images are loaded, although paths are correct. In my Apache logs, I have plenty of :

(13)Permission denied: [client 87.231.108.18:57108] AH00         


        
相关标签:
6条回答
  • 2021-02-08 11:19

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

    0 讨论(0)
  • 2021-02-08 11:25

    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.

    0 讨论(0)
  • 2021-02-08 11:30

    setsebool -P httpd_enable_homedirs 1

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

    0 讨论(0)
  • 2021-02-08 11:31

    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 :)

    0 讨论(0)
  • 2021-02-08 11:42

    Or you can run

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

    In those folders...

    0 讨论(0)
  • 2021-02-08 11:43

    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/
    
    0 讨论(0)
提交回复
热议问题