http://windows.php.net/downloads/releases/ 下载windows上可用的php 当前版本为php-5.6.20-Win32-VC11-x64.zip
http://www.apachelounge.com/download/ 下载windows上可用的apche 默认是vc14也就是vs2015我们选择vc11即vs2012
解压httpd-2.4.20-win64-VC11.zip 到D盘 D:\Apache24
解压php-5.6.20-Win32-VC11-x64.zip 到D:\php56
新建一个php.ini 把php.ini-development里面的内容复制一份到php.ini 修改文件中的内容
extension_dir = "D:/php56/ext"
date.timezone = date.timezone = Asia/Shanghai
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
;extension=php_shmop.dll
D:\Apache24\conf\httpd.conf
# php5 support
LoadModule php5_module C:/php56/php5apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "D:/php56/php5apache2_4.dll"
ServerRoot "D:/Apache24"
DocumentRoot "D:/phpwebhome/blitz/public"
<Directory "D:/phpwebhome/blitz/public">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
Order allow,deny
Allow from all
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
#AllowOverride None
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
安装apache作为一个服务
cd D:\Apache24\bin\httpd.exe -k install -n ApacheService
启动服务
net start apacheservice
停止服务
net stop apacheservice
卸载服务
httpd.exe -k uninstall -n ApacheService
到
https://getcomposer.org/download/下载
Composer
windows下载 Composer-Setup.exe
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === '7228c001f88bee97506740ef0888240bd8a760b046ee16db8f4095c0d8d525f2367663f22a46b48d072c816e7fe19959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
第三条命令
php composer-setup.php 有可选参数
php composer-setup.php --install-dir=bin
php composer-setup.php --filename=composer
php composer-setup.php --version=1.0.0-alpha8
安装 Laravel
一 . 通过 Laravel 安装工具
首先,使用Composer下载Laravel 安装包:
不指定版本
composer global require "laravel/installer"
指定版本
composer global require "laravel/installer=~1.1"
windows上安装后的目录C:\Users\tiantian\AppData\Roaming\Composer\
把C:\Users\tiantian\AppData\Roaming\Composer\vendor\bin加入path路径
在指定目录执行
laravel new blitz
windows会报错
TTY mode is not supported on Windows platform.
二. 通过 Composer 在命令行运行 create-project 命令来安装 Laravel
composer create-project laravel/laravel --prefer-dist blitz
使用以下命令安装 Laravel 5.1 LTS
composer create-project laravel/laravel your-project-name --prefer-dist "5.1.*"
然后将网站根目录配置为 D:/phpwebhome/blitz/public
修改D:/phpwebhome/blitz/.env里面的内容
DB_HOST=localhost
DB_DATABASE=blitz
DB_USERNAME=root
DB_PASSWORD=123456
在mysql中新建一个叫blitz的数据库 (你可以指定成任意你想要的名字)
访问localhost/home
ok 安装完成