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.
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)
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:
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!