首先,安装 phpStudy ,安装后 localhost 测试是否成功。
然后,切换版本为 php-7.2.10-NTS + Nginx,选择非系统服务(开机不自启动)。
接着,可以测试下 localhost 是否正常显示,再在根目录D:\phpStudy\PHPTutorial\WWW
下打开 powershell 运行 (得先安装 composer):composer create-project topthink/think tp5
这里可能会报错:[Composer\Exception\NoSslException]
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl ex
tension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.
进入启动:
其他选项菜单 —> php扩展及设置 —> php扩展 —> php_openssl
tp5 安装成功后,测试 localhost 是否正常显示 tp5 首页,然后打开 nginx.conf 配置文件设置 URL重写:location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
最后,测试看看是否设置成功。