[[email protected] ~]# vim /usr/local/nginx/conf/nginx.conf +65 location ~ \.php$ { root html; # 打开该段配置并修改为如下蓝色部分 fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name; include fastcgi_params; }
[[email protected] ~]# /usr/local/nginx/sbin/nginx -t [[email protected] ~]# /usr/local/nginx/sbin/nginx -s reload
[[email protected] ~]# vim /usr/local/nginx/html/index.php <?php phpinfo(); ?>
访问 192.168.123.102/index.php 看是否能够解析:
时间: 2024-10-17 00:06:52