zoukankan      html  css  js  c++  java
  • 解决PHP5.6版本“No input file specified”的问题

    问题描述:使用TP框架做项目时,在启用REWRITE的伪静态功能的时候,首页可以访问,但是访问其它页面的时候,就提示:“No input file specified.”
    原因在于使用的PHP5.6是fast_cgi模式,而在某些情况下,不能正确识别path_info所造成的错误
    默认的.htaccess里面的规则:

    <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>

    “No input file specified.”,是没有得到有效的文件路径造成的。
    修改后的伪静态规则,如下:

    <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>

    仅仅就是在正则结果“/$1”前面多加了一个“?”号,问题也就随之解决了。

  • 相关阅读:
    c语言字符串_续
    c语言中文件的操作
    Linux基础知识
    netstat
    wireshark 过滤规则
    常用cmd命令
    优化过的redis封装类
    二十三岁,新的起点
    计划看的书目
    [转载]爱上一个给予你正能量的人
  • 原文地址:https://www.cnblogs.com/jiangxiaobo/p/9486781.html
Copyright © 2011-2022 走看看