编译安装php+nginx详细步骤 (2)

如图:

编译安装php+nginx详细步骤

配置nginx识别php文件
添加配置
vim /usr/local/nginx/conf/nginx.conf

location ~ \.php$ { root /usr/local/nginx/html; #网站目录 fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }

现在去创个php文件试试

echo "<?php phpinfo();?>">>/usr/local/nginx/html/phpinfo.php

浏览器访问xxx.xxx.xxx.xxx/index.php:

编译安装php+nginx详细步骤

到这里php和nginx都安装完成了

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwxszd.html