介绍
这篇文章主要介绍了centos系统安装php 7.2时出现异常问题怎么办,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获、下面让小编带着大家一起了解一下。
我们知道centos系统内部是自带了php 5的,因此在安装php 7.2时可能会遇到很多问题。下面我们就来一一解决安装过程中遇到的问题。
首先获取rpm:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel -发布最新7. - noarch.rpm ,, rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
然后可以利用sudo百胜列表php *查看目前都有php的什么版本了,可以发现从4 - 7.2的版本都有,7.2版本名为72 w,因此安装该版本即可:
sudo yum -y install php72w
遇到问题:
Transaction check 错误: file 才能;/etc/httpd/conf.d/php.conf 得到install of mod_php72w 7.2.14 - 1. w7.x86_64 conflicts with file 得到package php - 5.4.16 el7.x86_64——46. file 才能;/etc/httpd/conf.modules.d/10-php.conf 得到install of mod_php72w 7.2.14 - 1. w7.x86_64 conflicts with file 得到package php - 5.4.16 el7.x86_64——46. 错误概要 - - - - - - - - - - - - -
解决:
yum -y remove php - 5.4.16 el7——46.。x86_64
但安装完毕后,输入php - v发现并没有该命令,因为php72w只是安装了php最小的库,一些应用还未安装,因此安装一些拓展包即可:
(学习视频分享:php视频教程)
yum -y install php72w-cli php72w-common php72w-devel php72w-mysql
遇到问题:
错误:php72w-common冲突与php -常见5.4.16 el7——46.。x86_64
您可以尝试添加——skip-broken选项来解决该问题
您可以尝试执行:rpm va——nofile nodigest
解决:
yum -y remove php -常见5.4.16 el7——46.。x86_64
然后输入php - v出现如下信息:
PHP 7.2.14 (cli),(建立:Jan 12, 2019, 12:47:33), (, NTS ) Copyright (c), 1997 - 2018,从而PHP 组 Zend Engine  v3.2.0, Copyright (c), 1998 - 2018, Zend 技术
感谢你能够认真阅读完这篇文章,希望小编分享的“centos系统安装php 7.2时出现异常问题怎么办”这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!