Question

I am trying out Laravel for the first time and have installed it on my Mac (OSX Mavericks) along with an existing install of MAMP 5.4.14 (PHP 5.4.14, Apache 2). I have various other projects (CakePHP) installed on MAMP and have no issues serving the files from aliased directories. However Laravel doesn't seem to like the config it came with or what I used for CakePHP and I haven't found a solution yet.

In my Apache config I have this defined as my alias:

Alias /laravel/ "/Users/user1/Documents/Web Development/laravel/public/“

<Directory "/Users/user1/Documents/Web Development/laravel/public”>
Options +Indexes +MultiViews +FollowSymLinks
AllowOverride All
Require all granted
</Directory>

and in the Laravel public folder I have this in the htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /laravel/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

Unfortunately all I get is a standard Apache 403 error.

[Sat Mar 22 17:29:38.408215 2014] [authz_core:error] [pid 31418] [client ::1:51107] AH01630: client denied by server configuration: /Users/user1/Documents/Web Development/laravel/public/\xe2\x80\x9c

Can anyone offer some hints as to what I am overlooking? Thanks

Edit - additional info

Chmod'd the entire laravel directory to 777 didn't help

Laravel app.php file has

'url' => 'http://localhost:8080/laravel',

I ran the internal php server and it worked correctly (php artisan serve), although it threw an exception on base64_decode

Also tried the default htaccess

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On
RewriteBase /laravel/

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Was it helpful?

Solution

Well, I should have noticed the \xe2\x80\x9c in the apache message, which is the dreaded curly quotes. Copying and pasting between editors managed to muck up my config files. Here is the final config just for reference:

Apache alias conf:

Alias /laravel/ "/Users/user1/Documents/Web Development/laravel/public/"
Alias /laravel "/Users/user1/Documents/Web Development/laravel/public"

<Directory "/Users/user1/Documents/Web Development/laravel/public">
    Options +Indexes +MultiViews +FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

htaccess file in my laravel project is the default

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
    RewriteBase /laravel/

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

and I can access it at

http://localhost:8080/laravel/

Hope this helps someone else!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top