LNMP之 php解析
# vim /usr/local/nginx/conf/nginx.conf打开以下PHP 相关项且更改 scripts$fastcgi_script_name;> /usrlocal/nginx/html$fastcgi_script_name;
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/usr/local/nginx/html$fastcgi_script_name;
#(scripts$fastcgi_script_name;)
include fastcgi_params;
更改完成以后,保存退出。通过 ip地址可以访问到 nginx的首页。
如下图:(如果访问不了可以 尝试关掉linux 自带的防火墙 iptables -F)
# iptables -F
# cd /usr/local/nginx/html/# 在此目录下写一个 info.php的脚本
# ls
50x.htmlindex.html
# vim info.php# 编译一个 info.php 脚本
<?php
phpinfo();
?>
通过IP 可以访问到以下内容
至此PHP 解析测试成功。
页:
[1]