yum install epel-release -y
yum install nginx -y
systemctl start nginx
systemctl enable nginx
yum install -y php php-devel php-fpm php-mysql php-common php-devel php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel
systemctl start php-fpm
systemctl enable php-fpm
这里不介绍了,可以参考我的源码安装,或者yum安装在“系统监控”的zabbix教程里面有
[root@jenkins ~]# cat /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name 10.0.40.245;
root /usr/share/nginx/html;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root /usr/share/nginx/html;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
重启nginx即可
[root@jenkins ~]# cat /usr/share/nginx/html/index.php
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>
10.0.40.245/index.php
原文:http://blog.51cto.com/yanconggod/2089950