apache环境下,解决php版本切换到5.6以上出现No input file specified.问题,.htaccess文件
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
改成:
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] </IfModule>
nginx环境下:查看错误日志,发现文件路径不对,中间缺少一部分多了一些空格,原因是\t被解析为空格,加上转义符“\”即可
server {
listen 80;
server_name www.tp6.net www.tp6.net;
root "D:\phpstudy\PHPTutorial\WWW\\tp6\public";
location / {
index index.html index.htm index.php;
#autoindex on;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
还有问题,改下php.ini配置文件:
找到 ; cgi.force_redirect = 1 去掉前面分号,把后面的1改为0 即 cgi.force_redirect = 0 二.apache No input file specifi
文章评论(0)