Tuesday, March 21, 2017

Laravel showing code of index.php on home page

I'm using Apache 2.4 on Ubuntu 16.04 and I have tested other sites are working, I mean the PHP code is executed. However, when I point Laravel's public folder to the virtual host, it shows the content of the index.php in browser.

enter image description here

here's the code of my site's conf file:

<VirtualHost *:80>

        DocumentRoot /var/www/laravel/public
        ServerName riskplant.dev

        <Directory /var/www/laravel/public>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
</VirtualHost>

Why the home page renders index.php as text file?

Note: I have set 777 permissions to laravel folder.



via Faizan Ali

Advertisement