Apache

第一个问题就是关于PHPStudy集成Apache环境下5.5版本以上”No input file specified“问题。

针对TP5框架,以下是.htaccess文件的配置,PHP 5.5版本以下可以正常使用。

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

然而上述配置文件切换到5.6版本以上就不可使用,直接报错“No input file specified”。修改成以下配置即可正常访问。

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

Nginx 

接下来再说一下TP5版本在nginx环境下支持PATHINFO模式和隐藏index.php的方法,本例是在centos7.0版本、nginx1.4.4版本下操作的,配置代码如下。我是直接在nginx.conf文件中进行配置的。

server {
listen 80;
server_name www.abc.com;
root /weixin/public;
index index.php;
#隐藏index.php
location / {
if (!-e $request_filename) {
#一级目录
# rewrite ^/(.*)$ /index.php/$1 last;
#二级目录
rewrite ^/(.*)$ /index.php/$1 last;
}
}
location ~ \.php($|/) {
fastcgi_pass localhost: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;
}
access_log logs/aicaiche.access.log main;
}

PHP开发笔记(三)关于PHP伪静态的问题总结的更多相关文章

  1. Django开发笔记三

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.基于类的方式重写登录:views.py: from ...

  2. RBL开发笔记三

    2014-08-26 20:06:24 今天就是在开发这个EPOLL来处理网络事件 封装较为健壮的EPOLL模型来处理基本的网络IO 1) 超时这个主题先没有弄 在开发EPOLL包括select/po ...

  3. Vue-cli开发笔记三----------引入外部插件

    (一)绝对路径直接引入: (1)主入口页面index.html中头部script标签引入: <script type="text/javascript" src=" ...

  4. 钉钉开发笔记(三)MySQL的配置

    最近在编写web的过程中,经常需要与后台工作人员互动.由于比较麻烦.没有效率. 就果断的请教了,公司的后台大牛,学习下数据库的一些简单操作,现在就把利用MySQL连接服务器, 进行可视化操作的简单步骤 ...

  5. openwrt开发笔记三:uci移植及API调用

    1.uci编译安装.移植 安装依赖 libubox #安装cmake sudo apt-get install cmake #下载依赖库libubox git clone http://git.nbd ...

  6. Django开发笔记六

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.登录功能完善 登录成功应该是重定向到首页,而不是转发 ...

  7. Django开发笔记五

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.页面继承 定义base.html: <!DOC ...

  8. Django开发笔记四

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.邮箱激活 users app下,models.py: ...

  9. Django开发笔记二

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.xadmin添加主题.修改标题页脚和收起左侧菜单 # ...

  10. Django开发笔记一

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.运行 python manage.py runser ...

随机推荐

  1. Python----递归------Eight Queens 八皇后问题

    递归思想是算法编程中的重要思想. 作为初学者,对递归编程表示很蒙逼,每次遇到需要递归的问题,心里就有一万头草泥马飞过~~~~~~(此处略去一万头草泥马) 在B站看数据结构与算法的视频时,视频中给了两个 ...

  2. Spring Boot学习总结(4)——使用Springloaded进行热部署

    我在开发的时候,总是会及时对自己的程序进行测试,总是频繁的重启web server,容器不烦我们都觉得烦了. dependencys目录下增加: <dependency> <grou ...

  3. 创建Spark执行环境SparkEnv

    SparkDriver 用于提交用户的应用程序, 一.SparkConf 负责SparkContext的配置参数加载, 主要通过ConcurrentHashMap来维护各种`spark.*`的配置属性 ...

  4. Spring MVC SessionAttributes ModelAttribute注解

    说明 本文主要针对 @SessionAttributes注解 和 @ModelAttribute注解的基础用法进行解析.至于为什么会将这两个注解放在一起,是因为它们之间还是有点影响的. @Sessio ...

  5. Supervisor-进程监控自动重启

    Supervisor是一个进程监控程序. 需求一:我现在有一个进程需要每时每刻不断的跑,但是这个进程又有可能由于各种原因有可能中断.当进程中断的时候我希望能自动重新启动它,此时,我就需要使用到了Sup ...

  6. [Tools] Using colours in a NodeJS terminal - make your output pop

    Use can use colour and styles to make it easy to spot errors and group common functionality into blo ...

  7. RPC通信功能实现

    Table of Contents RPC通信功能实现 配置參数 调用方法 RPC通信功能实现 HBase的RPC通信功能主要基于Protobuf和NIO这两个组件来实现.在通信管道上选择的是prot ...

  8. 用protractor測试canvas绘制(二)

    上一篇写了通过webdriver在浏览器环境下异步调用js代码. 今天进入正题. 事实上有了executeAsyncScript,一切就呼之欲出了. 直接上代码: var compareImage=f ...

  9. 单点登录cas常见问题(八) - 什么时候会用到代理proxy模式?

    举一个样例:有两个应用App1和App2,它们都是受Casserver保护的,即请求它们时都须要通过Cas server的认证. 如今须要在App1中通过Http请求訪问App2,显然该请求将会被Ap ...

  10. Extjs grid 某列点击弹窗

    { header : "单号", tooltip : '单号', dataIndex : 'transportCode', width : 130, sortable : true ...