centos7下用yum的方式安装php7.2

1、配置php源

yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2、yum list installed | grep php 查询是否安装

3、安装php-fpm

yum install php72w-fpm

4、安装php的扩展

yum -y install  php72w-cli php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-pdo php72w-xml php72w-pear php72w-devel 

其他的扩展如下,按照自己的需求安装

php72w-cli 
php72w-common 
php72w-devel 
php72w-embedded 
php72w-fpm 
php72w-gd 
php72w-mbstring 
php72w-mysqlnd 
php72w-opcache 
php72w-pdo 
php72w-xml 
php72w 
php72w-bcmath 
php72w-dba 
php72w-enchant 
php72w-imap 
php72w-interbase
php72w-intl 
php72w-ldap  
php72w-mcrypt 
php72w-odbc 
php72w-pdo_dblib 
php72w-pear 
php72w-pecl-apcu 
php72w-pecl-imagick 
php72w-pecl-xdebug 
php72w-pgsql 
php72w-phpdbg 
php72w-process 
php72w-pspell 
php72w-recode 
php72w-snmp 
php72w-soap 
php72w-tidy 
php72w-xmlrpc 
php72w-pecl-igbinary 
php72w-intl 
php72w-memcached 
php72w-pecl-mongodb

5、查看是否成功安装

php -v  #查看是否成功安装
php -m  #查看所有的扩展

6、配置文件所在的位置

php.ini                   /etc/php.ini

phpize                   /usr/bin/phpize

php-config             /usr/bin/php-config

php-fpm.conf         /etc/php-fpm.conf

php-fpm.pid           /var/run/php-fpm/php-fpm.pid

7、启动php-fpm

service php-fpm start/stop/restart

8、卸载php-fpm

1、停止php服务 service php-fpm stop

2、yum -y remove php*

3、rpm -qa|grep php 查询所有关于php的包并逐个删除

注意各种包的依赖关系,正确的大致顺序是

# rpm -e php-mysql-5.1.6-27.el5_5.3 
# rpm -e php-pdo-5.1.6-27.el5_5.3 
# rpm -e php-xml-5.1.6-27.el5_5.3 
# rpm -e php-cli-5.1.6-27.el5_5.3 
# rpm -e php-gd-5.1.6-27.el5_5.3 
# rpm -e php-common-5.1.6-27.el5_5.3 

4、最后再查看是否已经删除干净 php -v

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页