thinkphp 在lnmp上配置。(nginx1.10.2)
来源:互联网 发布:淘宝合伙开店协议 编辑:程序博客网 时间:2024/06/06 18:07
1、概述
thinkphp 不能直接在nginx上使用 因为要用pathinfo。 云云总总查了好多,也没配好。
2、配置
2.1 修改PHP.INI 支持 PHPINOF
PHP配置文件:/usr/local/php/etc/php.ini
更改php.ini
找到:cgi.fix_pathinfo=0
更改为:cgi.fix_pathinfo=1
2.2 修改nginx配置文件
配置文件路径查询:nginx -t 显示出路径
server { listen 80 default_server; #listen [::]:80 default_server ipv6only=on; server_name www.lnmp.org; index index.html index.htm index.php; root /home/wwwroot/default; #error_page 404 /404.html; #include enable-php.conf; include enable-php-pathinfo.conf; location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1; } } location ~ \.php { #fastcgi_pass remote_php_ip:9000; fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi_params; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } location /nginx_status { stub_status on; access_log off; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } access_log /home/wwwlogs/access.log; }include vhost/*.conf;}
3、重启
lnmp restart
0 0
- thinkphp 在lnmp上配置。(nginx1.10.2)
- thinkphp 在lnmp环境下的url重写配置
- 搭建lnmp环境(nginx1.9.15-源码)
- 搭建lnmp环境(nginx1.9.15-源码)
- LNMP环境的搭建配置(CentOS6.2+nginx1.1.15+mysql5.6+php5.3.10)
- LNMP环境的搭建配置(CentOS6.2+nginx1.1.15+mysql5.6+php5.3.10+redis+memcached)
- Thinkphp在Nginx上的配置
- ThinkPHP在Nginx上的URL配置
- 在LNMP或Nginx上配置NameCheap免费SSL
- 在LNMP或Nginx上配置NameCheap免费SSL证书
- LNMP 配置NGINX 支持THINKPHP PATHINFO模式
- lnmp搭建(Nginx1.12.1;mysql5.7.20;php7.2.0)
- Mac 上配置LNMP教程
- CentOS6.5+Nginx1.9+Mysql5.7+PHP7.0.6(LNMP)环境配置
- 在fedora中配置LNMP(linux + nginx + mysql +php)
- 在Ubuntu16.04配置Nginx1.10.3,基础配置教程
- RHEL5上配置LNMP环境安装shopex
- 【最新版lnmp编译安装】编译安装nginx1.10.2最新版、php7.0.12最新版、mysql5.7.16最新版
- iOS自学笔记之UISlider
- 设计模式 —— 状态模式g
- TypeScript基础-类型与变量
- HDP学习--YARN Resource Management(00)
- 变速练习
- thinkphp 在lnmp上配置。(nginx1.10.2)
- 文章标题
- 好奇心是怎么驱动成功的
- 4540: [Hnoi2016]序列
- 诗雨带你彻底征服AndroidStudio的安装与配置问题!
- ISD9160学习笔记04_ISD9160音频编码代码分析
- VirtualBox下Linux与Windows主机共享文件夹
- 终于开通了自己的学习记录博客
- spark配置:spark集群