lnmp1.3 网站根目录可以正常访问php,访问子目录php文件报错
lnmp1.3 网站根目录可以正常访问php,访问子目录php文件报错no input file specified.user.ini目录设置正常
子目录访问html文件正常,只有php不能正常显示
网站日志:
49.85.217.1 - - "GET /client/cart.php HTTP/1.1" 404 56 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
网站配置文件:
server
{
listen 80;
#listen [::]:80;
server_name www.shadowsocks.me shadowsocks.me;
return 301 https://www.shadowsocks.me$request_uri;
index index.html index.htm index.php default.html default.htm default.php;
root/home/shadowsocks;
include wordpress.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_paramHTTPS on;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
}
server {
listen 443;
server_namewww.shadowsocks.me;
index index.html index.htm index.php;
root /home/shadowsocks;
ssl on;
ssl_certificate shadowsocks.crt;
ssl_certificate_key shadowsocks.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM; #Disables all weak ciphers
ssl_protocols SSLv3 TLSv1; #enables SSLv3/TLSv1, but not SSLv2 which is weak and should no longer be used.
root@iZ62li3b1hsZ:/usr/local/nginx/conf/vhost# cat shadowsocks.me.conf
server
{
listen 80;
#listen [::]:80;
server_name ;
return 301 https://www..me$request_uri;
index index.html index.htm index.php default.html default.htm default.php;
root/home/shadowsocks;
include wordpress.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_paramHTTPS on;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
}
server {
listen 443;
server_nameme;
index index.html index.htm index.php;
root /home/shadowsocks;
ssl on;
ssl_certificate shadowsocks.crt;
ssl_certificate_key shadowsocks.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM; #Disables all weak ciphers
ssl_protocols SSLv3 TLSv1; #enables SSLv3/TLSv1, but not SSLv2 which is weak and should no longer be used.
ssl_prefer_server_ciphers on;
include wordpress.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_paramHTTPS on;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log/home/wwwlogs/www..me.log;
} 是php版本和程序不兼容的问题。已解决 重新更换php版本后,还是出错no input files specified.
用命令行php index.php正常,
但是浏览器SSL访问就是no input file specified
回复 3# 的帖子
估计可能是lnmp vhost add添加的网站,后来修改的配置文件里虚拟主机的目录,但是没修改.user.inihttps://lnmp.org/faq/lnmp-vhost-add-howto.html#user.ini
修改了.user.ini
已经确认.user.ini正常,但还是那个错误。网站根目录的wordpress正常
只有子目录里的whmcs用浏览器访问不正常,
用命令行php index.php就可以(whmcs目录里的index.php)。 在命令行里wget http://domain/client/index.php 可以get到正确的html文件。
但浏览器里就出现 no input specified。
页:
[1]