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 到仓库地址找到哦该文件 删除两个文件就可以了
随机推荐
- puppet运维配置实列
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABQkAAAGBCAIAAABKMKAEAAAgAElEQVR4nOydeXwU9cH/t2o9WutR+7
- fileupload控件上传、文件下载
常遇到上传下载的功能,这里把我习惯的用法写下来: 上传: string fileName = "";fileName = this.fu_pic.FileName;if (stri ...
- Zabbix lld发现磁盘监控
一.软件版本 操作系统:CentOS-6.5-x86_64 zabbix版本:3.0.3 二.脚本编写: 1.python版本: #!/usr/bin/env python import json i ...
- 远程使用Gpupdate(Hash,哈希)
function Start-GPUpdate { param ( [String[]] $ComputerName ) $code ...
- zTree实现地市县三级级联DAO接口实现
zTree实现地市县三级级联DAO接口实现 ProvinceDaoImpl.java: /** * @Title:ProvinceDaoImpl.java * @Package:com.gwtjs.d ...
- ubuntu上如何安装和卸载google chrome 浏览器
切换到安装文件目录 $ sudo dpkg -i file_name.deb 如果有错误,请运行以下命令 $ sudo apt-get -f install or $ sudo apt-get ins ...
- Android5.0之TextInputLayout、FloatingActionButton的使用
TextInputLayout和FloatingActionButton都属于MD风格的控件,比起普通的EditText和Button.ImageButton,TextInputLayout和Floa ...
- android activity启动的4种方式记录及打开其他应用的activity的坑
Android启动的四种方式分别为standard,singleTop,singleTask,singleInstence. standard是最常见的activity启动方式,也是默认的启动的方式. ...
- IBM发布AppScan Source 8.7:减少iOS企业级应用安全风险
IBM发布AppScan Source 8.7:减少iOS企业级应用安全风险http://automationqa.com/forum.php?mod=viewthread&tid=2570& ...
- [置顶] html学习笔记,锚点,超链接,table布局,表头,h,sub,blockquote,ul,li,ol.dl,加入收藏,打印,弹出窗口
<a name="shouye"></a> <strong>strong加粗</strong> <br> 没有加粗 &l ...