安装php7.2
1,yum源默认的版本太低了,手动安装有一些麻烦,所以可以采用yum的方式进行安装。
2,检查当前安装的PHP包
yum list installed | grep php
如果有安装的PHP包,先删除他们
yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
3,更换rpm源
Centos 5.X:
rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
CentOs 6.x:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
CentOs 7.X:
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
4,如果想删除上面安装的包
rpm -qa | grep webstatic
rpm -e 上面搜索到的包即可
5,下面使用yum进行安装
#安装php5.5
yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_6
#安装php5.6
yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
#安装php7.0
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
6,安装php-fpm
yum install php55w-fpm
yum install php56w-fpm
yum install php70w-fpm
CentOS自带了PHP5,安装PHP7.2的时候会遇到一些冲突.
参考:https://blog.csdn.net/xieliang5210/article/details/87157892
首先获取rpm:
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
1
2
然后可以利用 sudo yum list php*查看目前都有php的什么版本了,可以发现从4-7.2的版本都有,7.2版本名为72w,因此安装该版本即可:
sudo yum -y install php72w
1
遇到问题:
Transaction check error:
file /etc/httpd/conf.d/php.conf from install of mod_php72w-7.2.14-1.w7.x86_64 conflicts with file from package php-5.4.16-46.el7.x86_64
file /etc/httpd/conf.modules.d/10-php.conf from install of mod_php72w-7.2.14-1.w7.x86_64 conflicts with file from package php-5.4.16-46.el7.x86_64
错误概要
-------------
1
2
3
4
5
6
解决:
yum -y remove php-5.4.16-46.el7.x86_64
1
但安装完毕后,输入php -v发现并没有该命令,因为php72w只是安装了php最小的库,一些应用还未安装,因此安装一些拓展包即可:
yum -y install php72w-cli php72w-common php72w-devel php72w-mysql
1
遇到问题:
错误:php72w-common conflicts with php-common-5.4.16-46.el7.x86_64
您可以尝试添加 --skip-broken 选项来解决该问题
您可以尝试执行:rpm -Va --nofiles --nodigest
1
2
3
解决:
yum -y remove php-common-5.4.16-46.el7.x86_64
1
然后输入php -v出现如下信息:
PHP 7.2.14 (cli) (built: Jan 12 2019 12:47:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologie
安装php7.2的更多相关文章
- CentOS 7.1编译安装PHP7
原文: https://typecodes.com/web/centos7compilephp7.html?utm_source=tuicool&utm_medium=referral 1 创 ...
- 编译安装PHP7并安装Redis扩展Swoole扩展
编译安装PHP7并安装Redis扩展Swoole扩展 在编译php7的机器上已经有编译安装过php5.3以上的版本,从而依赖库都有了 本php7是编译成fpm-php 使用的, 如果是apache那么 ...
- centos 7.2 安装PHP7.1+apache2.4.23
安装准备: http://ftp.cuhk.edu.hk/pub/packages/apache.org//httpd/httpd-2.4.23.tar.gz 下载apache http://cn ...
- 【安装PHP】如何在openSUSE42.1下编译安装PHP7
首先推荐一篇文章PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog. 里面说到是否会去使用PHP7, ...
- centos6.4下安装php7+nginx+mariadb环境
一,安装php71,创建php用户和用户组,并在github下载php7源码#新建php用户和php组# groupadd -r php && useradd -r -g php -s ...
- 搭建LNAMP环境(四)- 源码安装PHP7
上一篇:搭建LNAMP环境(三)- 源码安装Apache2.4 一.安装PHP7 1.yum安装编译php需要的包 yum -y install libxml2 libxml2-devel curl- ...
- WINDOWS和Linux上安装php7 alpha 并安装 yaf
WINDOWS和Linux上安装php7 alpha 并安装 yaf PHP技术 widuu 2个月前 (06-15) 126浏览 0评论 windows 1.windows上安装 php7 ...
- Centos 7 通过YUM安装 PHP7 NGINX1.1.8 POSTGRESQL9.5
转载 1.最小化安装CENTOS7 2.更新源: yum update reboot 3.安装扩展源: yum install epel-release 4.安装工具软件: yum install w ...
- HomeBrew 安装 PHP7.1(开发笔记)
HomeBrew 安装 PHP7.1 $ brew update $ brew tap homebrew/dupes $ brew tap homebrew/php $ brew update $ b ...
- Centos7下安装php7
通过编译的方式安装php7 1. 安装PHP7 ## 下载 wget http://us2.php.net/distributions/php-7.0.2.tar.gz ## 安装 tar zxvf ...
随机推荐
- solr8.0.0基本安装和在springboot中的基本使用(win10)
1.下载solr 下载地址:http://archive.apache.org/dist/lucene/solr/ 该地址可以也可以下载以前的版本,我这边下载的solr-8.0.0.zip版本.下载完 ...
- cat <<EOF> file
.多行导入文件(新建文件或者覆盖文件内容) cat << EOF > abcd.txt Hello! This is a test file! Test for cat and ...
- windows更新系统系统时无法更新
win7系统显示“windows update当前无法检查更新,因为未运行服务,您可能需要重新启动计算机” 解决方法 1.win+r打开运行窗口,输入CMD 2.在dos窗口中输入命令“net sto ...
- input框随输入的文字的多少自动调整宽度粗略版本
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- [Python Cookbook]Pandas: How to increase columns for DataFrame?Join/Concat
1. Combine Two Series series1=pd.Series([1,2,3],name='s1') series2=pd.Series([4,5,6],name='s2') df = ...
- git commit 后 尚未push到远程,撤销commit
执行commit后,还没执行push时,想要撤销这次的commit,该怎么办? 解决方案: 使用命令: git reset --soft HEAD^ 这样就成功撤销了commit,如果想要连着add也 ...
- 元祖&字典
#什么是元祖:元祖是一个不可变的列表(没有改的需求) #======================================基本使用============================== ...
- Java--HashMap排序
package connection; import java.util.Collections; import java.util.Comparator; import java.util.Hash ...
- 怎样在 Akka Persistence 中实现分页查询
在 Akka Persistence 中,数据都缓存在服务内存(状态),后端存储的都是一些持久化的事件日志,没法使用类似 SQL 一样的 DSL 来进行分页查询.利用 Akka Streams 和 A ...
- 吴裕雄--天生自然Linux操作系统:Linux 简介
Linux 内核最初只是由芬兰人林纳斯·托瓦兹(Linus Torvalds)在赫尔辛基大学上学时出于个人爱好而编写的. Linux 是一套免费使用和自由传播的类 Unix 操作系统,是一个基于 PO ...