centos7 nginx完整支持thinkphp pathinfo模式开启方法
thinkphp运行在linux+nginx,如何开启pathinfo模式,我是完整测试过了,没问题的,在thinkphp配置文件 开启 'URL_MODEL' => 1, 1代表pathinfo模式
1,第一步 开启pathinfo
php.ini 开启 cgi.fix_pathinfo=1
2,第二步 配置nginx
server {
listen 80;
server_name www.96net.com.cn;
root /var/www/www.96net.com.cn;
location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
3,第三步 重启服务
systemctl restart nginx.service
systemctl restart php-fpm.service
最新文章
- Android 在线更新apk
- 字符串连接,数字tostring,写入文件
- MysqlServer如何实现成功卸载,并成功安装
- 2015 Multi-University Training Contest 2 1006 Friends
- oracle,sqlserver,mysql 命令行 开启、关闭所需要的服务
- cpio的简单使用
- ios开发入门篇(二):Objective-C的简单语法介绍
- ural 1250
- Java反编译器安装及各版本介绍
- Check SMTP Server Availability for ORA-29278 or ORA-29279 errors using UTL_SMTP to Send Email
- Play Modules Morphia 1.2.9a 之 Aggregation and Group aggregation
- Linux学习笔记之Django项目部署(CentOS)----进阶篇
- C/C++字符串函数使用整理
- 使用 PySide2 开发 Maya 插件系列二:继承 uic 转换出来的 py 文件中的类 Ui_Form
- A1016. Phone Bills
- Laravel创建产品-CRUD之Create and Store
- wgrib读grib数据
- Linux各种类型压缩包解压缩方法
- Xcode 8 的 Debug 新特性 —- WWDC 2016 Session 410 &; 412 学习笔记
- AngularJS内建服务以及自定义服务的用法