Laravel Symfony CodeIgniter

Laravel is the new CodeIgniter, a coding framework on top of PHP for simplified/standardised syntax. Complex PHP applications can become un-supportable without a coding framework like those in place.

To install and demo Laravel on WAMP:

(1) follow the steps in (note, uses a different WAMP php.ini file from normal).

(2) File c:\wamp\www\laraveltest\public\.htaccess then needs

RewriteBase /laraveltest/public/

added under the RewriteEngine line, as at

(3) Using WAMP click on wamp icon > apache > apache modules > scroll and check ‘rewrite_module Restart a LoadModule’

(4) Then edit c:\wamp\www\laraveltest\app\routes.php and browse to http://localhost/laraveltest/public/user to see effects.

(5) For database connectivity, edit c:\wamp\www\laraveltest\app\config\database.php to specify database name.

(6) To demo database connectivity, again edit c:\wamp\www\laraveltest\app\routes.php to add code like

Route::pattern('id', '[0-9]+');
Route::get('/user/{id}', function($id)
    // Only called if {id} is numeric.
    $user = DB::table('users')->where('id', $id)->first();

    echo '

prev | next

'; });

And browse to http://localhost/laraveltest/public/user/1 to see working.

A table called ‘users’ was used for this demo, with an ‘id’ numeric field plus some text fields

  `name` varchar(250) NOT NULL,
  `email` varchar(400) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY (`id`)
INSERT INTO `users` (`id`, `name`, `email`, `description`) VALUES
(1, 'John Smith', '', 'John''s description field...'),
(2, 'Jane Doe', '', 'Jane''s description field');

More database code at, and forms code at

For debugging, look in file c:\wamp\www\laraveltest\app\storage\logs\laravel.log

Currently Laravel supports four database systems: MySQL, Postgres, SQLite, and Microsoft SQL Server, but does not support Oracle However the Laravel-OracleDB driver package is avilable as an add on

An alternative to Laravel is Symfony.

Installation of Symfony requires composer – but that should already have been installed along with Laravel above, which means would now just need:

mkdir c:\wamp\www\symfony
cd c:\wamp\www\symfony
composer create-project symfony/framework-standard-edition myproject/ ~2.4
php app/console server:run


Once installed, browse to http://localhost:8000/ and also http://localhost:8000/demo/hello/YourNameHere.

May 2, 2014

Leave a Reply

Your email address will not be published. Required fields are marked *