archlinux 下 nignx + php 出現 no input file specified

奇葩的問題,配置 nginx + php + mysql 後,加一個站點:php

 

server {
        listen       80;
        server_name  wei.abc.com;
        root /www/wei.abc.com/;
        index  index.html index.htm index.php;

#       if (!-f $request_filename) {
#               rewrite ^/(.*)$ /f.php last;
#       }

        location / {
        }

        location ~ \.php$ {
            root           /www/wei.abc.com;
                fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
}

 死活訪問都是 no input file specified,打開 /etc/php/php-fpm.conf,找到 access_log 打開,access_format打開,發現文件路徑也正確,配出 nginx 配置問題html

後發現 /etc/php.ini 中對 php 的路徑作了限制:mysql

open_basedir 中巴網站路徑加上便可,或者直接註釋掉也行(安全起見,仍是加一個目錄比較好)。nginx

相關文章
相關標籤/搜索