thinkphp 6出现错误 No input file specified

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

thinkphp 6出现错误 No input file specified_第1张图片

解决方法: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>

更改后:

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

你可能感兴趣的:(php,thinkphp,php,apache,thinkphp)