Centos7 Yum Installation PHP7.2 Process Tutorial Details

  • 2021-12-12 08:20:37
  • OfStack

Centos7Yum Install PHP7.2

1. Install the source

To install php72w, you need to configure an additional yum source address, otherwise you will report an error and cannot find the relevant software package.

The php high version of the yum source address has two parts, one of which is epel-release, and the other one is from webtatic. If you skip epel-release, an error will pop up when installing webtatic.

So, the command you need here is:


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.rpm

Of course, you can also choose the following command, which is also the same effect.


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

2. Clear version history

In order to prevent php collisions on centos, it is better to execute this command 1 times first.

yum -y remove php*

3. Install the expansion pack

In fact, there are many corresponding extension libraries. Here, everyone should pay attention to cli and fpm, while other related packages depend on your needs.


yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel 

There are also more luxurious versions:


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 installation, start the service


systemctl enable php-fpm.service
systemctl start php-fpm.service

5. Successful installation

Summarize

The above is the site to introduce you Centos7 Yum installation PHP7.2 process tutorial details, I hope to help you, if you have any questions welcome to leave me a message, this site will reply to you in time!


Related articles: