dimanche 20 octobre 2019

AWS: PHP Code is visible instead of executing it in virtual host

I am setting up Laravel on EC2. After setting initial permissions and groups,when I tried then I got Forbidden error. The log showed following errors:

[Sun Oct 20 08:02:10.648091 2019] [autoindex:error] [pid 29325] [client 39.48.136.176:51852] AH01276: Cannot serve directory /var/www/html/my_project/public/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Sun Oct 20 08:03:03.010061 2019] [autoindex:error] [pid 29326] [client 54.163.75.130:53702] AH01276: Cannot serve directory /var/www/html/my_project/public/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Sun Oct 20 08:18:05.310327 2019] [mpm_prefork:notice] [pid 29321] AH00169: caught SIGTERM, shutting down

PHP Info worked fine when I put a file in var/www/html but all messed up when I cloned my Laravel folder and it started showing the code. After adding DirectoryIndex index.html index.php it starts showing code.

Below are different conf files details.

<VirtualHost *:80>
        ServerName example.com
        DocumentRoot /var/www/html/my_project/public/
        <Directory "/var/www/html/my_project">
                DirectoryIndex index.html index.php
                AllowOverride All
                Options FollowSymLinks
        </Directory>
</VirtualHost>

Httpd.Conf parts:

# Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
#IncludeOptional conf.d/*.conf
Include /etc/httpd/conf/vhosts/example.conf

I do not know what's going wrong. I had setup a previous AWS instance with PHP 7.1 and Apache and it did not have any such issues. I am now with PHP 7.3



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire