Laravel shows index.php code on main page

I am using Apache 2.4 on Ubuntu 16.04, it shows content of index.php in browser.

enter image description here

here's the code for my conf file:

<VirtualHost *:80>

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

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

      

Why is the main page displaying index.php as a text file?

Note. I have set 777 permissions to laravel folder. PHP is also installed.

+3


source to share


1 answer


I got the solution here .



Actually, I had to install libapache2-mod-php

and activate it, i.e.a2enmod php7.0

+6


source







All Articles