Recently saw some statistics, said that Laravel is currently the most used PHP framework, so you want to learn. Before actually also wanted to learn this framework, but every time to the first step to install the time stuck, helpless. Before using thinkphp, download and put to the site directory can be used, but also to toss a lot of other things. Today finally installed successfully, the original installation is very simple, record the next step ~
First, the preparation of pre-installation work 1. Configuring the PHP Environment
First you need to configure the PHP runtime environment, where I directly use the Wampserver integration package. Since the Laravel framework has some system requirements, it is recommended that you download a higher version to meet the following criteria.
- PHP version >= 5.4
- Mcrypt PHP Extension
- OpenSSL PHP Extensions
- mbstring PHP Extension
- Tokenizer PHP Extension
I am using the 2.5 version and are installed directly under the D:\wamp .
2. Installing composer
The Laravel framework uses Composer to manage its dependencies. So before you use Laravel, you have to make sure that you have Composer installed on your computer.
To composer download the installation package under Windows, click Install directly after download complete – "Next" – select "Install Shell Menus" – "next", this step needs to be selected php.exe Path, because I use the WAMP package, installed under D:\wamp , so select the path "D:\wamp\bin\php\php5.5.12\php.exe", After continuing "Next", this time will download a composer.phar file (may be slower, recommended pre-installation fq~), after a while to wait, composer installation is complete.
Second, installation Laravel
This step is installed directly through the Composer create-project command.
Open the directory you want to install to, I choose to install to the D:\wamp\www directory, right-click "Use Composer here", or the direct Win+R key to open cmd.exe, and then go to the installation directory. Then install it by using the following command:
- Composer Create-project Laravel/laravel laravel5
The last one is the name of the installation build directory that can be modified, while the others cannot be modified. After a period of waiting, the installation laravel is complete.
Now, with the http://localhost/laravel5/public
following, it means that the initial installation is complete.
Third, change the composer source
In the process of installing laravel, due to the use of foreign composer source, often appear the following prompt and installation failure, you can switch to some of the domestic sources to solve:
- [composer\downloader \transportexception
- the< Span class= "PLN" > "Https://packagist.org/packages.json" file could not be downloaded: Ssl/ tls already set-up for< Span class= "PLN" > this stream
- Failed to open Stream: cannot Connect to HTTPS server through proxy
- First find the composer home directory from the command line:
- Composer Config -l -g
The contents of the [home] configuration item are as follows:[home] C:/users/administrator/appdata/roaming/composer
- Then go to the directory and edit the config.json file under this directory as:
- {
- "config": {},
- "Repositories": [{
- "Type": "Composer",
- "url": "http://comproxy.cn/repo/packagist"
- }, {
- "Packagist": false
- }]
- }
Or:
- {
- "config": {},
- "Repositories": [
- {"type": "Composer", "url": "http://pkg.phpcomposer.com/ repo/packagist/"},
- {"packagist": false}
- ]
- }
You can then run the Laravel installation command from the new operation.
Note: the Laravel 5The site entrance is the Laravel 5 installation directory under the
/public directory, rather than the Laravel 5 installation directory, this point needs attention! http://my.oschina.net/rain21/blog/418833
[Laravel 5 Tutorial Study notes] One, Windows installation Laravel 5