Install PHP
Note One: Laravel 5.0 started on the PHP version of the requirement is >=5.4
that Laravel 5.1 requires PHP version >=5.5.9
, so, we recommend you try to install the latest version of 5.5.x, when writing this article, the latest version is 5.5.27
.
Note Two: PHP 5.4 is the last version that supports Windows XP and Windows 2003, so it is recommended that you stay away from XP. See also: http://windows.php.net/
Download and set up PHP
Go to http://windows.php.net/download/to download the latest version of PHP 5.5.x. If you are using a x64 system, it is recommended to download a version that supports x64. thread safe
and non thread safe
The representative is whether to support thread safety, which we choose non thread safe
.
Unzip the downloaded PHP installation package to any directory, this recommendation is extracted to the C packing directory, the final PHP installation path will be C:\php
.
Add the PHP installation path to the PATH
environment variable. Because we're going to use PHP's command-line tool this time, this setting is important.
Enter the PHP installation directory (for example C:\php
). Locate the php.ini-development
file and copy it to the current directory and rename it to php.ini
.
php.ini
to open the file with the editor, modify the following configuration:
Remove extension=php_mbstring.dll
The preceding semicolon (888 rows or so)
Remove extension=php_openssl.dll
the preceding semicolon (893 rows or so)
Remove extension_dir = "ext"
the preceding semicolon (736 rows or so)
Download Laravel 5.1
Lravel provides a one-click installation package for all versions of Laravel 4.x and 5.x (Lumen also available!). ), go to the download page to download the latest version of Laravel v5.1.x (v5.1.3 when writing this article):
http://www.golaravel.com/download/
Let Laravel run.
- To extract the downloaded Laravel one-click installation package to any directory, we assume that the root directory of the C drive is extracted, the final path is:
C:\laravel-v5.1.3
.
- Open a new command prompt window and
cd
go to the Laravel installation directory:cd c:\laravel-v5.1.3
Enter and execute php artisan serve
the instruction, you can see the following prompt:
It means that Laravel has run!
Open the browser, enter in the Address bar localhost:8000
, and enter to see if there is a familiar screen:)
What's going on?
In fact, starting with PHP version 5.4, PHP has built-in (built-in) a Web server, and Laravel's artisan command also supports this built-in Web server, which makes it easier for beginners to get started quickly and start Laravel. Of course, if you are deploying to a production server, you will want to install a Web server such as Apache or Nginx.
artisan
The serve
command also supports two parameters:
host
Set the host address
port
Set the port number that Web server listens on
For example:php artisan serve --port=8888
Quickly install and run Laravel 5.x on Windows