第一次从 TP5.1 转换到 TP6,在搭建项目时候 报错: No input file secified.

在这里插入图片描述

解决方法public下的.htaccess文件

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

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

更改前:

<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&gt;

更改后:

<IfModule mod_rewrite.c&gt;
    Options +FollowSymlinks -Multiviews
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注