yum安装php和php扩展
报错背景:
#1.移除旧版php
[root@nginx ~]# yum remove php-mysql-5.4 php php-fpm php-common
#2.安装扩展源
[root@nginx ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@nginx ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#3.安装php7.1版本
[root@nginx ~]# yum -y install php56w php56w-cli php56w-common php56w-devel \
php56w-embedded php56w-gd php56w-mcrypt php56w-mbstring php56w-pdo php56w-xml php56w-fpm \
php56w-mysqlnd php56w-opcache php56w-pecl-memcached php56w-pecl-redis php56w-pecl-mongodb php56-pecl-memcache
#4.替换php-fpm运行的用户和组身份
[root@web02 ~]# sed -i '/^user/c user = nginx' /etc/php-fpm.d/www.conf
[root@web02 ~]# sed -i '/^group/c group = nginx' /etc/php-fpm.d/www.conf
发现php71上没有memcache扩展,php56上有,所以
卸载php71:
yum -y remove php71w php71w-cli php71w-common php71w-devel \
php71w-embedded php71w-gd php71w-mcrypt php71w-mbstring php71w-pdo php71w-xml php71w-fpm \
php71w-mysqlnd php71w-opcache php71w-pecl-memcached php71w-pecl-redis php71w-pecl-mongodb
安装php56:
yum -y install php56w php56w-cli php56w-common php56w-devel \
php56w-embedded php56w-gd php56w-mcrypt php56w-mbstring php56w-pdo php56w-xml php56w-fpm \
php56w-mysqlnd php56w-opcache php56w-pecl-memcached php56w-pecl-redis php56w-pecl-mongodb php56-pecl-memcache
如果没有需求用php-memcache扩展的话,可以选择安装php71.
作者:wangkaiok —— 小菜鸟111
出处:http://www.cnblogs.com/wangkaiok/
本文版权归作者和博客园共有,但未经作者同意禁止转载,转载必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。