As PHP continues to be updated, many users may encounter such problems: how to check whether PHP7 has been installed in the system.
This article will introduce how to use the yum command to check whether PHP7 is installed.
First, we need to open a terminal window. If you are a Linux user, you can use the following command to open a terminal window:
Press Ctrl Alt T to open a terminal window.
Once you open the terminal, you can confirm whether PHP7 is installed by running the following command:
yum list installed | grep php
In this command, yum list installed
is used to list List all installed software packages on the current system. The pipe character (|) is used to pass the output of this command as the input of the next command.
grep php
The command looks for lines containing the keyword "php" in the output.
The output of this command will display all installed PHP related software. If you have PHP7 installed, the PHP7 version information should be displayed in the output.
Also, if you want to know the currently available PHP packages, you can use the following command to search for available PHP packages:
yum search php
This command will display all available PHP packages as well Their description information. You can browse this list to find the package you need and install it.
If you have not installed PHP7, you can install it through the following command:
yum -y install php
This command will download and install the latest PHP7 package available on the system.
In summary, by using the above command, you can easily check whether PHP7 is installed on your system. If you haven't installed it yet, you can install the latest PHP7 package through the yum command.
The above is the detailed content of How to check if PHP7 is installed using yum command. For more information, please follow other related articles on the PHP Chinese website!