ubuntu thinkphp pathinfo 404等问题
这个问题 困扰了我一天,由于对nginx的配置文件中的各种变量不懂。配置起来很麻烦,从网上搜索的,感觉合适自己的不多!!!
找啊找啊。。终于找一篇!!!!
我的环境: php 5.3. ubuntu 12.04 LTS nginx 1.2.
http://www.nginx.cn/426.html 这一篇,我找到了适合自己的部分。这种代码好像不能完全套用。。。。
1 首先编辑 php.ini
例如我的是:
sudo vim /etc/php5/fpm/php.ini
找到cgi.fix_pathinfo ,把前面的 ; 号去掉,值设为0
#按照下面这样设置
cgi.fix_pathinfo =
2 修改nginx的配置文件 --- nginx.conf
#根目录配置部分 ---------
location / {
root /usr/local/nginx/html;
index index.php index.html index.htm;
}
# php的配置部分
location ~ ^.+\.php {
fastcgi_pass unix:/dev/shm/php.socket;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
3 修改thinkPHP项目中的conf
sudo vim /usr/local/nginx/html/test/project1/Conf/config.php
// pathinfo 模式设置成 1
'URL_MODEL' => ,
好了,经过上面这些配置,在浏览器打开一个空白页,输出地址,看看正确否~~~~
希望这段分享能帮助你!!!
ubuntu thinkphp pathinfo 404等问题的更多相关文章
- ubuntu+ngnix+thinkphp pathinfo配置
一.thinkphp 项目改为pathinfo模式 XXX/ThinkPHP/Conf/convention.php文件中找到 'URL_MODEL' => 1, // URL访问模式,可选参数 ...
- thinkphp pathinfo nginx 无法加载模块:Index
thinkphp 报了 无法加载模块:Index 错误位置 FILE: /var/multrix/wxactivity_archive/ThinkPHP/Library/Think/Dispatche ...
- centos7 nginx完整支持thinkphp pathinfo模式开启方法
thinkphp运行在linux+nginx,如何开启pathinfo模式,我是完整测试过了,没问题的,在thinkphp配置文件 开启 'URL_MODEL' => 1, 1代 ...
- 如何开启服务器 thinkphp pathinfo的访问方式
这篇文章主要介绍了ThinkPHP中pathinfo的访问模式.路径访问模式及URL重写总结,是ThinkPHP路由访问的基础知识,在ThinkPHP开发中非常重要,需要的朋友可以参考下 本文针对Th ...
- Ubuntu nginx 配置404错误页面
1.创建自己的404.html页面: 2.更改nginx.conf在http定义区域加入: /etc/nginx# vim nginx.conf 下添加 fastcgi_intercept_error ...
- Ubuntu/Debian apt-get 404 Not Found Package Repository Errors,无法找到包的错误
最简单最常用的方法是,使用如下命令更新到新的版本: sudo apt-get dist-upgrade 但是这个方法有时候不一定能起作用,那么可以使用以下直接替换的命令: sudo sed -i -e ...
- Thinkphp 自定义404页面
一. 手册->调试->异常处理 在公共config.php 中加入: 'TMPL_EXCEPTION_FILE' => '/Public/404.html', //访问不存在的跳转 ...
- lnmp1.2支持ThinkPhp pathinfo及rewrite
一.pathinfo支持方法 1.2版本系统已经自动生成了一个pathinfo的配置文件,但实测不可用,所以我们先找打这个文件并修改其内容,文件路径为:/usr/local/nginx/pathinf ...
- 错误:22 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu bionic Release 404 Not Found [IP: 91.189.95.83 80]
https://blog.csdn.net/chenbetter1996/article/details/80255552 到仓库地址找到哦该文件 删除两个文件就可以了
随机推荐
- 局域网内Linux服务器时间同步
局域网内Linux服务器时间同步 1.将一台能够上网的服务器作为时间服务器: # /usr/bin/rdate -s time-b.timefreq.bldrdoc.gov //将时间服务器与互 ...
- java dubug调试
摘要:调试不仅可以查找到应用程序缺陷所在,还可以解决缺陷.对于Java程序员来说,他们不仅要学会如何在Eclipse里面开发像样的程序,更需要学会如何调试程序.本文介绍了Java程序员必知的10个调试 ...
- 问题-"Record not found or changed by another user"
回答1:===============================================================问题:clientdataset“Record not found ...
- PAT 1089. Insert or Merge (25)
According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and gr ...
- android访问asset目录下的资源
android提供了AssetManager来访问asset目录下的资源, 在activity中通过getAssets()获取AssetManager 常用的api如下: 1.列举路径下的资源Stri ...
- UVALive 6088 Approximate Sorting 构造题
题目链接:点击打开链接 题意: 给定一个n*n的01矩阵 我们跑一下例子== 4 0111 0000 0100 0110 0123 \|____ 0|0111 1|0000 2|0100 3|0110 ...
- Android 软件开发之 PreferenceActivity 中的组件
1.PreferenceActivity 介绍 PreferenceActivity 继承ListActivity 它是以一个列表的形式在展现内容,它最主要的特点是添加Preference可以让控件的 ...
- MYSQL在线注释文档--- 在gdb中显示源码(gdbtui使用方法)----赖明星的个人博客
http://mingxinglai.com/cn/2013/07/gdbtui/ MySQL源码注释与类图 http://mingxinglai.com/cn/2015/08/mysql-annot ...
- FAQ系列 | 解读EXPLAIN执行计划中的key_len
http://imysql.com/2015/10/20/mysql-faq-key-len-in-explain.shtml
- Link-local address
A link-local address is an Internet Protocol address that is intended only for communications within ...