I use Wamp on my Windows box for developing PHP based apps, I recently installed Laravel on my Windows box to test how to framework works and performs common tasks related to web development. I would keep posting good stuff I learned about Laravel in easy to follow steps for new developers of Laravel like me.
- Laravel used Composer for dependency management, so first I installed Composer for Windows. Like to download is: https://getcomposer.org/Composer-Setup.exe
During the Composer installation, it would ask for the location of PHP.exe, so make sure you have installed PHP on your system before you install Composer.
- It would download a few things from internet, so wait with patience. It uses SSL, so make sure SSL module is enabled in your php.ini file, just remove the “;” before the like: “extension=php_openssl.dll”. The php.ini file is located at your php’s installation home folder.The installation would also set the composer location into you windows path environmental variable, so that you can use composer command from Command Prompt.
- Download the Laravel Installer using Composer. On your Command Prompt, enter:
composer global require “laravel/installer=~1.1”
It would install all dependencies e.g. Symfony Console, Guzzlehttp Guzzle, Laravel Intaller, etc.
- Add your ~/.composer/vendor/bin path into Path environmental variable, so that Windows Command Prompt could identify laravel command that would be used later to install Laravel and doing other tasks. In my case the path where its located is:
so I added it into my Path environmental variable. Must restart your Shell or Command-Prompt so that updated Path variables is loaded.
- Its time to create our first Laravel applications. For it, we need to install the Laravel itself. Afte you have done the above steps, its very simple. Issue following command at Command Prompt:
laravel new app-name
make sure your current directory is where you need your project to be created. In my case, I got following output by running the laravel new command:
D:OtherDataLaravelApps>laravel new addressbook Crafting application... Application ready! Build something amazing.
The addressbook folder contents looks like this:
The mail folder where our major web applications components would be located is “app”, its default structure is following:
第一个下载：安装 Composer Windows 版本的
在cmd模式下运行：composer global require “laravel/installer=~1.1”
E:wwwtest>laravel new blog
PS：Laravel 要推出5.1LTS了 值得花点时间学习！