升级至 PHP7

距离 php7 发布已经有段时间了,大家可能现在用的都还是 php5,php7 这次更新,带来了很多特性,特别是just in time JIT 即时编译技术,让 php7 的执行速度快了不少倍!

php7 yum源

CentOS/RHEL 6.x

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

CentOS/RHEL 7.x

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

安装 php7

卸载 php5(如果有的话)

yum -y remove php php-fpm php-common
rpm -qa | grep php  # 卸载干净

php7 - apache

yum -y install php70w php70w-opcache

php7 - nginx

yum -y install php70w-fpm php70w-opcache

php7 - 模块

yum -y install php70w-devel php70w-mysql php70w-gd libjpeg* php70w-imap php70w-ldap php70w-odbc php70w-pear php70w-xml php70w-xmlrpc php70w-mbstring php70w-mcrypt php70w-bcmath php70w-mhash libmcrypt