[安装ThinkCMF]
安装时不要开 xdebug 扩展
public/index.php是项目的入口文件,请配置服务器时把 public 目录做为 web 目录
[环境要求]
PHP >= 7.4.0
PDO
MBstring
CURL
[本地开发环境要求]
PHP >= 7.4.0
PDO
MBstring
CURL
[推荐服务器配置]
PHP >=8.0
MySQL >=5.7
CentOS >=6.5
Nginx
[下载 ThinkCMF]
[官网下载]
https://www.thinkcmf.com/download.html
[composer下载]
正式版:
composer create-project thinkcmf/thinkcmf thinkcmf6
开发版
composer create-project thinkcmf/thinkcmf:6.0.*-dev thinkcmf6_dev
[开发版github下载]
首先下载仓库到本地
git clone -b 6.0 https://github.com/thinkcmf/thinkcmf thinkcmf6
[开发版码云下载]
首先下载仓库到本地
git clone -b 6.0 https://gitee.com/thinkcmf/ThinkCMF thinkcmf6
[nginx配置参考]
server{listen 80;server_name demo.thinkcmf.com;root 你的 ThinkCMF6.0目录/public; # 该项要修改为你准备存放相关网页的路径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;}#proxy the php scripts to php-fpmlocation ~ \.php {include fastcgi_params;##pathinfo支持start#定义变量 $path_info ,用于存放pathinfo信息set $path_info "";#定义变量 $real_script_name,用于存放真实地址set $real_script_name $fastcgi_script_name;#如果地址与引号内的正则表达式匹配if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {#将文件地址赋值给变量 $real_script_nameset $real_script_name $1;#将文件地址后的参数赋值给变量 $path_infoset $path_info $2;}#配置fastcgi的一些参数fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;fastcgi_param SCRIPT_NAME $real_script_name;fastcgi_param PATH_INFO $path_info;###pathinfo支持endfastcgi_intercept_errors on;fastcgi_pass 127.0.0.1:9000;# fastcgi_pass 如果是 sock形式,可能是下面的配置# fastcgi_pass unix:/tmp/php-cgi.sock}}
[虚拟机配置参考]
https://www.kancloud.cn/thinkcmf/faq/1197179
