Home > Article > Backend Development > How to install php7 with yum under Centos?
How to install php7 under yum in Centos?
1. Installation source
To install php7
, you need to configure additional yum
source address, otherwise an error will be reported and the relevant software package cannot be found.
##phpThe source address of the higher version of
yum has two parts, one of which is
epel- release, and the other part comes from
webtatic. If
epel-release is skipped, an error will pop up when installing
webtatic.
rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmOf course, you can also choose the following command, which will have the same effect.
yum install epel-release -y rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
2. Clear historical versions
In order to preventphp conflicts from happening on
centos, so this command should be done first It would be better to implement it.
yum -y remove php*
3. Install php7 and various extensions
cli These two packages are and
fpm, and other related packages depend on your needs.
yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-develThere is also a more luxurious version:
yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
4. After the installation is completed, start the service
systemctl enable php-fpm.service systemctl start php-fpm.service
5. The installation is successful
For more related knowledge, please visitPHP Chinese website! !
The above is the detailed content of How to install php7 with yum under Centos?. For more information, please follow other related articles on the PHP Chinese website!