Today, I was preparing to install Laravel on the VIRTUAL machine. After reading the document, it was said that version 7.2.5 or above was required, so KAKaka needed to change the PHP version, and then this article came into being. All of kaka’s articles follow a process from a problem solution to a final solution. If you just want to know the result, you can read the end of the article directly.

Delete all PHP packages in 3 seconds using RPM command

When installing all the frameworks and packages, the first thing you have to look at is the project environment. You can see that Larave requires PHP version 7.2.5 or higher.Go to the virtual machine to see the VERSION of PHP that you can usephp -vTo see the version.

PHP has been deleted. This command cannot be executed. Embarrassing…

So kaka just before using RPM – qa | grep PHP instructions displayed information to show you the kaka before version

This version is installed with RMP, so it also needs to be uninstalled with RPM. At this point all PHP packages have been removed

That kaka is how to delete!

Still using RPM -e php70w…. That’s a real waste of time, too much time to spend deleting files.

And some packages have dependencies, which you must have encountered when deleting them.

This error means that the installation package you need to uninstall is being used by another package.Kaka teaches you to use a command to resolve these worries.rpm -e --nodeps rpm -qa | grep php

At this point, it takes about 3 seconds to delete all the PHP installation packages. Isn’t it very nice


2. Common parameters of RPM instruction

The main function of RPM is to install, uninstall and upgrade.

Here are some common RPM parameters to use.

  • -e Uninstalls the RPM package
  • -i Install the RPM package
  • -u Upgrades RPM packages
  • Nodeps does not verify software package dependencies

These are the parameters that ka-ka often uses.

Install PHP7.2

The installation source

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
Copy the code

Or you could use this

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

Install the required extensions

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
Copy the code

When the execution is complete, check the version number for 7.2Nginx should be accessible in the browser as it was installed before clicking.