Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localhost Error with Laravel 5.1 on Ubuntu 14.04

Have had a look at previous articles here, but with no luck. I've just installed Laravel 5.1 via composer. I've been following the official documentation for installation, located here. I'm not using homestead and I'm neither using a virtual environment. While everything works fine, I'm having trouble hosting the project up on my web server. While regular PHP files are hosted easily and are accessible via my localhost, accessing the public folder of Laravel via my localhost is giving me a 500 internal server error. Following the tutorial, my public/.htaccess file has the following contents.

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

My error log's most recent entry is as follows.

[Thu Nov 19 22:25:10.012710 2015] [core:alert] [pid 6461] [client 127.0.0.1:43086] /var/www/html/blog/public/.htaccess: Options not allowed here

As for permissions, I have given permissions to all files and folders within my Laravel app's folder. I'm running Apache/2.4.7 (Ubuntu) and PHP 5.5.9-1ubuntu4.14 on my machine.

Please do let me know if you need any other information. Any help will be highly appreciated!

EDIT:

Solved the problem by adding the following in my apache2.conf:

<Directory />
      AllowOverride All
</Directory>

Thanks everyone.

like image 488
Izy- Avatar asked Nov 19 '15 17:11

Izy-


1 Answers

You must have missed a configuration in your config file. Best way to test this is to remove this line from your htaccess file.

Options +FollowSymLinks

Then try it.

Make sure that your apache2.conf is providing all options. Sometimes you'll have something like this

AllowOverride FileInfo AuthConfig Limit Indexes

If that is the case change it to

AllowOverride All

Edit:

So in your .htaccess file you can have.

DirectoryIndex index.php
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
like image 199
Panama Jack Avatar answered Oct 14 '22 19:10

Panama Jack