PHP 7 添加了很多新特性,而且运行速度也比之前版本提高了不少,本文介绍 CentOS 7 系统下 PHP 7 的安装过程。

安装


更新 RPM 包并安装

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum -y install php70w php70w-opcache php70w-fpm php70w-mysql php70w-pdo php70w-pgsql php70w-xml php70w-mbstring php70w-mcrypt php70w-gd

sed -i 's/user = apache/user = nginx/' /etc/php-fpm.d/www.conf
sed -i 's/group = apache/group = nginx/' /etc/php-fpm.d/www.conf

启动 php-fpm

systemctl start  php70-php-fpm.service

开机启动设置

systemctl enable  php70-php-fpm.service