1.添加源
7的源:
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
6的源:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
2.yum安装php7.1及相关扩展
注:php71w-devel 提供了pecl功能
yum install php71w-common php71w-fpm php71w-gd php71w-pdo php71w-mysqlnd php71w-odbc php71w-mcrypt php71w-mbstring php71w-cli php71w-xml php71w-soap php71w-devel php71w-pear php71w-pecl-memcached php71w-pecl-redis
3.启用并开启服务
CentOS7:
systemctl enable php-fpm
systemctl start php-fpm
CentOS6:
chkconfig php-fpm on
service php-fpm start
网友评论