1.composer命令安裝php
安裝指定的 laravel版本 如下的案例是安裝5.6版本laravel
composer create-project laravel/laravel=5.6.* --prefer-dist(composer的安裝以及使用國內鏡像就不詳細說了)apache
2.出錯啦composer
筆者在執行composer後提示如下信息,大致是要求輸入受權用戶名密碼:ide
Loading composer repositories with package informationui
Updating dependencies (including require-dev) spa
Authentication required (packagist.phpcomposer.com):orm
3.解決方式:ci
(1)使用laravel-china社區的源:域名
composer config -g repo.packagist composer https://packagist.laravel-china.org
接下來就能夠執行我們的composer操做了
4.配置apache虛擬主機
1)hosts文件中添加虛擬域名
2)httpd-vhosts.conf添加如下內容
<VirtualHost *:8080>
DocumentRoot "D:\phpStudy\PHPTutorial\WWW\LaravelStudy\public"
ServerName laravel.study.com
ServerAlias
<Directory "D:\phpStudy\PHPTutorial\WWW\LaravelStudy\public">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>