[安装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下载]

正式版:

  1. composer create-project thinkcmf/thinkcmf thinkcmf6

开发版

  1. composer create-project thinkcmf/thinkcmf:6.0.*-dev thinkcmf6_dev

[开发版github下载]

首先下载仓库到本地

  1. git clone -b 6.0 https://github.com/thinkcmf/thinkcmf thinkcmf6

[开发版码云下载]

首先下载仓库到本地

  1. git clone -b 6.0 https://gitee.com/thinkcmf/ThinkCMF thinkcmf6

[nginx配置参考]

  1. server{
  2. listen 80;
  3. server_name demo.thinkcmf.com;
  4. root 你的 ThinkCMF6.0目录/public; # 该项要修改为你准备存放相关网页的路径
  5. location / {
  6. index index.php index.html index.htm;
  7. #如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
  8. if (!-e $request_filename)
  9. {
  10. #地址作为将参数rewrite到index.php上。
  11. rewrite ^/(.*)$ /index.php?s=$1;
  12. #若是子目录则使用下面这句,将subdir改成目录名称即可。
  13. #rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1;
  14. }
  15. }
  16. location /api/ {
  17. index index.php index.html index.htm;
  18. #如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
  19. if (!-e $request_filename)
  20. {
  21. #若是子目录则使用下面这句,将subdir改成目录名称即可。
  22. rewrite ^/api/(.*)$ /api.php?s=$1;
  23. }
  24. }
  25. location ~* ^\/upload\/.+\.(html|php)$ {
  26. return 404;
  27. }
  28. location ~* ^\/plugins\/.+\.(html|php)$ {
  29. return 404;
  30. }
  31. location ~* ^\/themes\/.+\.(html|php)$ {
  32. return 404;
  33. }
  34. #proxy the php scripts to php-fpm
  35. location ~ \.php {
  36. include fastcgi_params;
  37. ##pathinfo支持start
  38. #定义变量 $path_info ,用于存放pathinfo信息
  39. set $path_info "";
  40. #定义变量 $real_script_name,用于存放真实地址
  41. set $real_script_name $fastcgi_script_name;
  42. #如果地址与引号内的正则表达式匹配
  43. if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
  44. #将文件地址赋值给变量 $real_script_name
  45. set $real_script_name $1;
  46. #将文件地址后的参数赋值给变量 $path_info
  47. set $path_info $2;
  48. }
  49. #配置fastcgi的一些参数
  50. fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
  51. fastcgi_param SCRIPT_NAME $real_script_name;
  52. fastcgi_param PATH_INFO $path_info;
  53. ###pathinfo支持end
  54. fastcgi_intercept_errors on;
  55. fastcgi_pass 127.0.0.1:9000;
  56. # fastcgi_pass 如果是 sock形式,可能是下面的配置
  57. # fastcgi_pass unix:/tmp/php-cgi.sock
  58. }
  59. }

[虚拟机配置参考]

https://www.kancloud.cn/thinkcmf/faq/1197179

[站群部署参考]

https://www.kancloud.cn/thinkcmf/faq/1200991