虚拟机下centos安装php7.0
之前在安装PHP的时候是在阿里云的环境直接安装的,但是在虚拟机中由于源的问题和系统的问题,导致PHP安装不成功,这里提供一中解决思路。一:阿里云或最新版本安装php7.0
yum install -y php70w php70w-pecl-apcu php70w-xml php70w-mcrypt php70w-gd php70w-devel php70w-mysql php70w-intl php70w-mbstring
二:安装错误解决
提示安装失败 八成是你的镜像中没有php7.0的源
我们先添加源
rpm -Uvh https://dl.fedoraproject.org/pub ... latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
执行安装
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
注意
如果在实际使用时,如果缺少相应的模块,需要执行命令
yum install php7.0w-xxx.x86_64
即可。
如:缺少gd模块,只需要执行命令
yum install php70w-gd.x86_64
页:
[1]