phpEnv本地安装ThinkCMF8
ThinkCMF8,一款开源内容管理框架,让WEB开发更快,节约时间玩猫!
这里不讲phpEnv的安装,请自行安装好phpEnv,环境切换到Nginx,PHP版本可以选8.2版本。
安装教程如下:
1、打开phpEnv
2、点击页面的《网站》按钮,点击《添加》;
3、设置域名(think.cmf),根目录(E:/phpEnv/www/think.cmf/),端口(80)和php版本(8.2);
4、点击《添加》,本地域名添加成功,然后本地就可以通过《think.cmf》域名访问了;
5、将下载好的thinkcmf8程序解压到根目录;
6、返回phpEnv的网站管理界面,右击《think.cmf》,点击配置;
7、基本里面的根目录,换成《E:/phpEnv/www/think.cmf/public》;
8、URL重写,写入以下代码
location / { index index.php index.html index.htm; #如果请求既不是一个文件,也不是一个目录,则执行一下重写规则 if (!-e $request_filename) { #地址作为将参数rewrite到index.php上。 rewrite ^/(.*)$ /index.php?s=$1; #若是子目录则使用下面这句,将subdir改成目录名称即可。 #rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1; } } location /api/ { index index.php index.html index.htm; #如果请求既不是一个文件,也不是一个目录,则执行一下重写规则 if (!-e $request_filename) { #若是子目录则使用下面这句,将subdir改成目录名称即可。 rewrite ^/api/(.*)$ /api.php?s=$1; } } location ~* ^\/upload\/.+\.(html|php)$ { return 404; } location ~* ^\/plugins\/.+\.(html|php)$ { return 404; } location ~* ^\/themes\/.+\.(html|php)$ { return 404; }
9、访问think.cmf域名,然后根据提示安装即可。
10、完。