thinkphp5学习记录一

 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处理,同时保留参数
        }

  

 
原文地址:https://www.cnblogs.com/brady-wang/p/9045356.html