http://www.jianshu.com/p/2836017b5348
Initialize configuration
- First, make sure your PHP version is above 5.59.
- Open PHP extension, found in php.ini
;extension=php_openssl.dll
;extension=php_mbstring.dll
;extension=php_pdo_mysql.dll
Remove the preceding semicolon and leave it intact if there is no semicolon. Install composer and use packagist China full-volume mirroring (Global Install/global configuration)
- Enter composer official website download page, at the bottom of the page manual download area Select the desired version download.
- Copy the downloaded Composer.phar to the PHP installation directory, which is the same level directory as Php.exe.
- Create a new Composer.bat file in the PHP installation directory and save the following code to this file.
"%~dp0composer.phar" %*
Open a command-line window and try the execution to composer --version
see if the version number is correctly printed.
Open a command-line window and execute the following command
composer config -g repo.packagist composer https://packagist.phpcomposer.com
This composer installation and configuration is complete
Laravel Installation
-
Open a command-line window to execute the D:
cd Xampp\htdocs
Enter the site directory and execute the following code to create a Laravel project named AMS (project name customization)
composer Create-project laravel/laravel ams --prefer-dist
The following is an Apache virtual host configuration designed to simulate domain name access, and if you do not need this functionality, enter localhost/ams/public
directly in the browser. If the Laravel5 Welcome screen (at the bottom of this article) is displayed normally, congratulations on your environment. Welcome interface loaded Google font file, so the first time you open may require a certain load time.
Open rewrite and Vhost, found in httpd.conf
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#Include conf/extra/httpd-vhosts.conf
Remove the previous #, if there is no #, stay the same.
- Locate
DocumentRoot "D:/xampp/htdocs"
the nearby <Directory>
label pair and change the contents to the following<Directory /> AllowOverride all Require all granted</Directory>
- Enter the httpd-vhost.conf in the D:\xampp\apache\conf\extra directory and add the last
<VirtualHost *:80> ##ServerAdmin [email protected].example.com DocumentRoot "D:\\xampp\\htdocs\\ams\\" ServerName ams.com ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common</VirtualHost>
Enter the Hosts file in the C:\Windows\System32\drivers\etc directory and add the following127.0.0.1 ams.com
Whether the browser input http://ams.com/public
test will display normally LARAVEL5 welcome page
Start your laravel journey!
Installation and configuration of Composer&laravel under Windows