location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;
include fastcgi_params;
}
2)编写php代码
写一个php测试页info.php,放到apache/htdocs目录
1 <?php 2 phpinfo(); 3 ?>
3)重新加载nginx配置
# /usr/local/nginx/sbin/nginx -s reload
4)测试
Ubuntu 16.10 开启PHP错误提示
Ubuntu 16.04环境中安装PHP7.0 Redis扩展
在 CentOS 7.x / Fedora 21 上面体验 PHP 7.0