Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Laravel MAMP Setup

Here's how I setup Laravel on MAMP:

1. Add a .htaccess file to the root of the application with the following rules:

<IfModule mod_rewrite.c>
	RewriteEngine on

	RewriteRule ^$ public/ [L]
	RewriteRule (.*) public/$1 [L]
</IfModule>

2. Added the following line somewhere in public/index.php:

if (strpos($_SERVER['HTTP_HOST'], 'localhost') !== false)
{
	$_SERVER['LARAVEL_ENV'] = 'local';
}
else
{
	$_SERVER['LARAVEL_ENV'] = 'production';
}

3. Create the application/config/local directory

4. Create the application/config/local/application.php file and put the following in it:

<?php

return array(

	'url' => 'http://localhost:8888/_app_name_'

);
@sineld

This comment has been minimized.

Copy link

sineld commented Jul 24, 2012

Did not work for me on Mamp.

@Fuhrmann

This comment has been minimized.

Copy link

Fuhrmann commented Feb 13, 2013

Not working here to. Using the last version of Laravel and XAMPP on Windows 7.

Actually I've made some tests and this work but the "index.php" stay in the URL. I've already erased the the "index.php" line in the application.php but it is not working.

Edit:

To anyone using XAMPP on Windows and don't want to alter the vhosts file this is the solution: http://forums.laravel.io/viewtopic.php?pid=17223#p17223

@scottymeyers

This comment has been minimized.

Copy link

scottymeyers commented May 29, 2013

This all helped. Also, had to change the following permissions:

chmod -R 777 storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.