Centos7的yum安裝PHP7及PHP擴展安裝

連接:http://www.qianxingweb.comphp

1.安裝epel:

#yum list installed | grep php
#查看已安裝的PHP,查到後rpm -e 卸載 #yum repolist all | grep php

yum install epel-release -y

2.安裝REMI源:

rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm

 

3.查看能夠安裝的PHP版本:

yum repolist all | grep php

 

 4.設置默認安裝的版本:

yum-config-manager --enable remi-php74

若提示:-bash: yum-config-manager: 未找到命令
代表未安裝yum-utlis包,yum -y install yum-utils 便可

 

5.安裝PHP:

yum -y install php
#查看PHP版本
php -v
#查看已安裝的模塊
php -m

6.查看哪些能夠安裝的PHP擴展:

yum search php74-php

 

7.安裝PHP擴展:

示例:安裝php74-php-fpm擴展,則執行:(不用加php74-)
yum -y install php-fpm

 

 8.php-fpm命令:

# 啓動
systemctl start php-fpm

# 中止
systemctl stop php-fpm

#重啓
systemctl restart php-fmp # 重載 systemctl reload php-fpm #設置開機啓動 systemctl enable php-fpm #禁止開機啓動 systemctl disable php-pfm

相關文章
相關標籤/搜索