Search code examples
linuxubunturedhat

Server issue - I can't access php files


I have some issues with my server, for example public_html is my root folder, if I put any php file in root I have this error:

403 Forbidden

You don't have permission to access /check.php on this server.

I try to change permissions on the file is the same. Now the php file is with 0644 permissions How I can solve this?

Thank you

this is what httpd conf

<Directory "/">
    Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
            Require all granted
                Allow from all
</Directory>

<Directory "/usr/local/apache/htdocs">
    Options All
    AllowOverride None
    Require all granted
</Directory>

<Files ~ "^error_log$">
    Order allow,deny
    Deny from all

    Satisfy All
</Files

Solution

  • Check if your public_html folder has 755 permission.

    If this doesn't work, check if In your /usr/local/apache/htdocs/httpd.conf settings are like the below

    <Directory "/usr/local/apache/htdocs">
        Options Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    

    If the settings are correct there, check your .htaccess file.

    Last but not the least. Check if your files and folders have the save usergroup as public_html folder