Find us on facebook

Apr 26, 2015

Installing Composer And Installing Laravel 5

Installing Composer

Before you install you need to enable php_openssl in php.ini file. Normally if you enable this on WAMP server,


It will uncomment php_openssl in D:/wamp/bin/apache/apache2.2.22/bin/php.ini file. But we need to uncomment D:/wamp/bin/php/php5.4.3/php.ini file to install composer. So manually uncomment the line extension=php_openssl.dll

Then;

You can download composer for windows from following link
https://getcomposer.org/download/
Under Windows Installer click on Composer-Setup.exe to download and then run.

Or you can use following command in CLI
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

To run php command under any folder in CLI you need to set environment variable. (PHP exe file path)
Eg: D:\wamp\bin\php\php5.4.3

Then restart the computer and open cmd, Then just type php and check.

C:\>php (If no error message displays, then your environment variable has set.

To check whether composer installed correctly you can type just "composer" and hit enter.(You need to go to composer installed folder)

Detailed screenshot shown below.


Installing Laravel 5

Now you have installed composer. Now create folder called laravel (Or any name) under www root folder and in cmd go to the location you have installed the composer and type following command and hit enter. It will create laravel 5 project called BATransfer (Instead this name you can use any name you prefer for your project)

C:\ProgramData\ComposerSetup\bin>composer create-project laravel/laravel D:/wamp
/www/laravel/BATransfer --prefer-dist

You can see detailed screenshot below.


After you install laravel successfully, You can see following folder structure under your directory.


You can access your laravel home page through following URL in localhost.

http://localhost/laravel/BATransfer/public/

That's all :D 

No comments:

Post a Comment