lNPM 环境搭建问题
已启动nginx个php-cgi
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2355/nginx
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 2212/php-cgi
phpinfo.php脚本
<?php
phpinfo();
?>
nginx配置
location / {
root html;
index index.php index.html index.htm;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /html$fastcgi_script_name;
include fastcgi_params;
}
打开localhost/ 能正常
打开localhost/phpinfo.php的时候 出来的是提示下载整个php文件 而不是php执行的结果
刚刚入手php 高高手解答 看了网上好多资料 还是没搞定