I have a website hosted using Apache in Azure. I was trying to access the website with http://example.com/laravel/public and it's showing me "Access denied" message and when I checked for the error log message, it's showing a proxy_fcgi:error AH01071 message as stated in the title. I am not sure if it's the htaccess configuration issue or other configuration which causes this issue. Please help.
In my .htaccess, I have the following configured:
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On
    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]
    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^ index.php [L]
    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
Seems like php-fpm does not have read permission on index.php
You could run the following on a terminal to know which user is actually running php-fpm :
# ps aux | grep php-fpm | awk '{print $1}'
You could then give permission on index.php to this specific user with the following (replace <php_fpm_user> with the result of the first command):
# setfacl -m u:<php_fpm_user>:r /var/www/html/laravel/public/index.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With