brady-wang

 

 

 

 1 使用composer安装

composer create-project topthink/think=5.0.* tpblog --prefer-dist

2 配置环境
vim /usr/local/nginx/vhost/my.conf

hosts增加
192.168.33.10 tpblog.yeves.com

listen 80;

server_name tpblog.yeves.com;
index index.html index.htm index.php default.html default.htm def
root /www/my/tpblog/public;

 

 

application下的index目录是模块,可以增加admin等各种模块 common模块不可直接访问

 

 可以将application目录改为app 

再把入口改为

// 定义应用目录
define(\'APP_PATH\', __DIR__ . \'/../app/\');
这样就和命名空间一致了

 

隐藏入口文件index.php:

 

location /
        {
                try_files $uri $uri/ /index.php?s=$uri&$args;
                #如果请求不是文件或目录,则将uri交给index.php处理,同时保留参数
        }

  

 

分类:

技术点:

相关文章:

  • 2021-08-25
  • 2021-12-23
  • 2021-10-21
  • 2021-12-10
  • 2021-12-30
  • 2021-11-14
  • 2021-06-02
  • 2021-10-06
猜你喜欢
  • 2021-11-07
  • 2021-11-05
  • 2021-09-17
  • 2021-09-19
  • 2021-09-28
  • 2021-06-06
  • 2021-05-18
相关资源
相似解决方案