Installing Laravel4 in Mac OSX with MAMP

Standard

Re-cap:
In the past and first tutorial of this series we learned how to create a virtual host with MAMP. In this second tutorial, we will install laravel4 PHP framework and will go another step toward developing a full laravel4 application series.

Precautions:

  • Make sure your installed PHP version is greater or equal to 5.3.7
  • Also make sure the MCrypt PHP extension is enabled
  • For pretty URL the mod_rewrite module is enabled on Apache

1. Install Composer Globally:

The following command will just check a few PHP settings and then download composer.phar

$ curl -sS https://getcomposer.org/installer | php

You can run these commands to easily access composer from anywhere on your system

$ sudo mv composer.phar /usr/local/bin/composer

2. Create a laravel project named “thisdayinbangladesh” inside our MAMP’s “htdocs” directory:

Going inside the “htdocs” directory

$ cd /Applications/MAMP/htdocs

Creating the project there

$ composer create-project laravel/laravel thisdayinbangladesh --prefer-dist

3. A small permission issue:

Lets enter into our project directory

$ cd thisdayinbangladesh/

Change the permission of the storage folder to writable

$ sudo chmod -R 0777 app/storage/

4. Basic Configuration:

Update line number 29 of the “app/config/app.php” file to

$ 'url' => 'http://thisdayinbangladesh.dev/',

and line 42 to

$ 'timezone' => 'Asia/Dhaka',

5. Database configuration:
Though configuring database is not necessary to have a first run but lets complete this step as we will not do any editing on the config files later.


'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'thisdayinbangladesh',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
 ),

6. Lets have a test run:

Open the URL of your laravel application as we created earlier using virtual host; on the browser. That is http://thisdayinbangladesh.dev/
You should arrive!

Advertisements

4 thoughts on “Installing Laravel4 in Mac OSX with MAMP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s