标签:request log dex oca home script lnmp scan res
1,把thinkphp5解压
2,添加配置项,项目路径和域名
nginx.config 或者自定义的main.config下加如下配置代码
重启服务器
server { listen 80; server_name hwl.tptest.com; #root /home/wwwroot/; set $root /home/wwwroot; location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ { expires 30d; access_log off; } location / { root $root; index index.html index.htm index.php; if ( -f $request_filename) { break; } if ( !-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } } location ~ \.php/?.* { set $script $uri; set $path_info ""; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; set $path_info $2; } fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php?IF_REWRITE=1; # include fastcgi.conf; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $script; include fastcgi_params; } }
3,出错了
删掉scandir函数
保存并重启nginx
4,输入路由
http://hwl.tptest.com/tptest/public/index.php/index/Index/index
标签:request log dex oca home script lnmp scan res
原文地址:http://www.cnblogs.com/ikoala/p/7265654.html