继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

window环境安装lumen步骤

weiyihigh
关注TA
已关注
手记 51
粉丝 104
获赞 364

window下安装
当前安装的lumen版本5.6 PHP版本7.2
第一步下载composer:
下载Windows平台下Composer的安装文件并安装:
https://getcomposer.org/Composer-Setup.exe
安装过程中需要选择你的php安装目录下的php.exe文件选择路径。(composer指定的php.exe文件版本不能低于新版lumen的支持版本,否则会导致下面的项目添加异常)
第二步切换镜像:
国外的网络问题一般需要切换到国内镜像:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
第三步添加lumen扩展:
composer global require "laravel/lumen-installer=~1.0"
第四步直接到指定目录用lumen命令创建框架目录:
lumen new blog
第五步重命名:
ren D:\soft\PHPstudy\PHPTutorial\WWW\blog.env.example .env
添加秘钥
以上参考来源(https://lumen.laravel-china.org/docs/5.3/installation
https://pkg.phpcomposer.com/)(http://blog.m1910.com/archives/1481.html

安装框架配置nginx
vhosts.conf文件
server {
server_name test.com;
root "D:/soft/PHPstudy/PHPTutorial/WWW/news/public";
index index.html index.htm index.php;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
注释:root "D:/soft/PHPstudy/PHPTutorial/WWW/news/public";
window下nginx.conf 配置路径如果用反斜杠可能导致无法获取到文件信息,从而报错。
图片描述
ng配置参考来源(https://blog.csdn.net/skykingf/article/details/45824255

打开App,阅读手记
1人推荐
发表评论
随时随地看视频慕课网APP