在经历了编译安装的痛苦之后,还是决定使用yum安装了
【可选】查询是否安装了软件,目的是卸载编译安装的php
rpm -qa | grep -i 软件名
rpm -qa | grep php
rm -rf /usr/local/php
修改yum下载源为阿里云的地址
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
添加阿里云的epel镜像源
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum clean plugins
yum makecache
安装remi扩展源
yum install epel-release
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
安装yum管理工具
yum install yum-utils
查找是否有php74
yum search php74
安装php
yum install php74-php-cli php74-php-common php74-php-devel php74-php-embedded php74-php-fpm php74-php-gd php74-php-mbstring php74-php-mysqlnd php74-php-pdo php74-php-opcache php74-php-xml php74-php-soap php74-php-bcmath php74-php-json php74-php-gmp php74-php-pecl-redis4 php74-php-pecl-mcrypt php74-php-process php74-php-pecl-zip php74-php-pecl-crypto php74-php-pecl-memcache php74-php-pecl-memcached
确认安装结果
yum list installed | grep php
建立软连接
通过remi安装的php的指令是php74,这里请根据实际情况建立一下软链接
ln -s /opt/remi/php74/root/usr/bin/php /usr/local/php/bin/php
ln -s /opt/remi/php74/root/usr/bin/php /usr/local/bin/php
查看php版本
php -v
启动fpm
service php74-php-fpm start
systemctl start php74-php-fpm
systemctl status php74-php-fpm
systemctl stop php74-php-fpm
设置开机启动
systemctl enable php74-php-fpm
来源地址:https://blog.csdn.net/sdutphp/article/details/128550700