问题遇到的现象和发生背景
访问index.html正常,访问index.php找不到文件
问题相关代码,请勿粘贴截图
php-fpm正常启动
[root@nginx sbin]# ps -ef |grep php-fpm
root 95107 1 0 15:55 ? 00:00:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
www 95108 95107 0 15:55 ? 00:00:00 php-fpm: pool www
www 95109 95107 0 15:55 ? 00:00:00 php-fpm: pool www
root 95239 24085 0 16:12 pts/0 00:00:00 grep --color=auto php-fpm
nginx配置文件
[root@nginx sbin]# cat /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name 192.168.139.102;
#charset koi8-r;
#access_log logs/host.access.log main;
#root /usr/local/nginx/html/wordpress;
root html;
location / {
#root html;
#root /usr/local/nginx/html/wordpress;
index index.html index.htm readme.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
# root /usr/local/nginx/html/wordpress;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /document_root$fastcgi_script_name;
include fastcgi_params;
}
}
测试用代码
[root@nginx sbin]# cat /usr/local/nginx/html/index.php
<?php
phpinfo();
?>
我想要达到的结果
不知道什么原因