Getting started with Laravel 4 on CentOS ... First Helloworld app with Laravel-4

Install PHP 5.4>:
At least PHP 5.4 is required to install laravel 4.
Uninstall old php versions php 5.3 <=
  1. yum remove php*

Install php 5.4:

  1. rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
  2. yum install php54w
Install php mcrypt extension:

  1. yum install php54w-mcrypt

Install PHP Data Objects (PDO) extension :

  1. yum install php54w-pdo

Install composer (Composer is a dependency manager for PHP.Something like Maven in Java.):

  1. cd /usr/local/bin/
  2. curl -sS https://getcomposer.org/installer | php
  3. mv composer.phar composer
  4. composer self-update

Run the following command to create your first laravel helloworld project:

  1. composer create-project laravel/laravel hello-laravel-4 --prefer-dist

This command will download and install a fresh copy of Laravel in a new hello-laravel-4 folder within your current directory.
Next run the composer install command in the root of your manually created project directory. 
  1. cd hello-laravel-4
  2. composer install
This command will download and install the framework's dependencies.
 Now give execute access to PROJECT_ROOT/app/ dir:


  1. chmod -R 777 app/

Make sure your current directory contains a file named artisan.
Now run the following command to run your first helloworld app:

  1. php artisan serve

Now browse to http://localhost:8000/ to see the output.You should see a screen saying 
"You have arrived." :)

No comments:

Post a Comment