php5.5版本改为php5.6,CI框架的路由使用REWRITE模式之后,出现了No input file specified.错误
php5.5程序对应的.htaccess(伪静态规则)配置:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*)$ index.php/$1 [L]
php5.6程序对应的.htaccess配置:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*)$ index.php?/$1 [L]
php5.6和php5.5的.htaccess配置区别就在于/$1前面加?
因为使用PHP是fast_cgi模式,而在某些情况下,是不能正确的识别到path_info,所以会出现No input file specified.错误。