1.先安装epel-release
yum -y install epel-release
2.切换源
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3.安装
yum -y install php56w php56w-mysql php56w-gd libjpeg* php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mbstring php56w-bcmath
yum -y install httpd php-gd56w php-intl56w php-mysql56w mod_ssl openssl mcrypt php5-mcrypt56w
yum -y install php56w-mcrypt php56w-soap php56w-intl php56w-pdo
yum install php56w-fpm php56w-opcache
systemctl start php-fpm
systemctl enable php-fpm
4.配置nginx的配置文件
location ~ \.php$ {
root /usr/share/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;
}
在/usr/share/nginx/html新建一个info.php
phpinfo();
5.浏览查看效果
在浏览器中输入您的服务器地址:http://192.168.137.128/info.php