TP5 使用php7出现no input file specified问题

出现该问题,需要重写rewrite规则, 具体解决方案如下, 在ThinkPhp5的public文件夹下有个文件 .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>

将 一下这一条语句

 RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

修改为:

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

修改以后的.htaccess文件为,

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

复制粘贴上述代码即可.

猜你喜欢

转载自blog.csdn.net/supramolecular/article/details/82774254
今日推荐