Home  >  Article  >  Backend Development  >  How to install php7 on centos yum

How to install php7 on centos yum

藏色散人
藏色散人Original
2020-08-19 09:55:383442browse

How to install php7 on centos yum: first install the corresponding yum source of PHP7; then install PHP7 through the command "yum install php70w"; finally, test whether the installation is successful through the "php -v" command.

How to install php7 on centos yum

CentOS7 is installed using yumPHP7

View system version command

[root@VM_176_162_centos ~]# cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core)

1. If you have installed other versions of PHP before, delete it first

yum remove php*

2.rpm installs the corresponding yum source of PHP7

CentOS/RHEL 7.x:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#目前 webtatic.com 最高只有php72  如果要更高的可使用下面的
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
CentOS/RHEL 6.x:
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

3.yum installs PHP7

yum install php70w

4. After the installation is completed, test whether the installation is successful

php -v

5. To run the PHP web page, start the php-fpm interpreter

service php-fpm start

6. Install other plug-ins (optional)

How to install php7 on centos yum

If you have trouble with this step, just execute the following command (if there is a conflict, follow the prompts to filter the conflict)

yum install php70w*  //意为安装全部插件

If you encounter a conflict that cannot be matched The problem should be caused by using zsh. Just switch to ordinary bash, as shown in the following figure:

How to install php7 on centos yum

The above is the detailed content of How to install php7 on centos yum. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn