Home > Backend Development > PHP7 > body text

How to install php7 on centos yum

藏色散人
Release: 2023-02-17 17:30:02
Original
3354 people have browsed it

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)
Copy after login

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

yum remove php*
Copy after login

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
Copy after login

3.yum installs PHP7

yum install php70w
Copy after login

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

php -v
Copy after login

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

service php-fpm start
Copy after login

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*  //意为安装全部插件
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!