I just installed an existing Laravel project onto a web server by git cloning. I have done as much proper setup as possible as per Laravel guidelines, including setting up Apache Virtual Hosts like so:
<VirtualHost *:80>
ServerAdmin email@gmail.com
DocumentRoot /var/www/html/project/public
<Directory "/var/www/html/project/public">
AllowOverride all
RewriteEngine On
RewriteBase /var/www/project/public
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I have also set up directory ownership / file permissions to the best of my ability. However, when visiting the website, the contents of public/index.php are displayed instead of the website being loaded. I know this has certainly been addressed somewhere before, and I apologize if that's the case, but I haven't been able to find clear answers. Much appreciated.
Other things I have done:
- installed php (it came loaded with the server and is version 5.5.9)
- a2enmod rewrite
- service apache2 reload
- modification of .htaccess
- ensured the loaded page is not a cached one
Resources used: