putenv proc_open
安装:
在网站根目录的命令行下执行下边命令,会自动安装thinkphp6的最新稳定版。
composer create-project topthink/think=6.* .
恢复禁用上边的两个函数。
查看版本号:
方法1,查看:composer.lock
"name": "topthink/framework",
"version": "v6.1.5",
方法2,执行命令:php think version
6.1.5
方法3,查看文件:vendor/topthink/framework/src/think/App.php
const VERSION = '6.1.4';
文件中的版本号和命令行还有lock中的不同,有点意思。。。这里正确的版本号目测应该是6.1.5
设置文件权限:
文件夹设置100,文件设置400,为了方便起见,可全部设置为500,然后某些需要写权限的加上就行了。
设置伪静态:
location ~* (runtime|application)/{
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
访问 / 或 /index
打开网站首页,如果看到:
ThinkPHP V6.1.4
16载初心不改 - 你值得信赖的PHP框架
说明安装成功了。顺便提一下这里的版本号6.1.4不一定正确,这里因该是调用的App.php中的VERSION。
访问 /hello/ss
hello,ss
参考文档:
官方文档列表:
https://www.thinkphp.cn/doc
thinkphp6文档
https://doc.thinkphp.cn/v6_1/anzhuangThinkPHP.html
仓库:
https://packagist.org/packages/topthink/think