centos7 升级php版本到7.2
#自带的只有5.4版本
1 | yum provides php |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | [root @localhost etc]# yum provides php Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com * webtatic: uk.repo.webtatic.com mod_php71w- 7.1 . 26 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 26 - 1 .w7 mod_php71w- 7.1 . 27 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 27 - 1 .w7 mod_php71w- 7.1 . 28 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 28 - 1 .w7 mod_php71w- 7.1 . 29 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 29 - 1 .w7 mod_php71w- 7.1 . 30 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 30 - 1 .w7 mod_php71w- 7.1 . 31 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 31 - 1 .w7 mod_php71w- 7.1 . 32 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 32 - 1 .w7 mod_php71w- 7.1 . 33 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.1 . 33 - 1 .w7 mod_php72w- 7.2 . 14 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.2 . 14 - 1 .w7 mod_php72w- 7.2 . 16 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.2 . 16 - 1 .w7 mod_php72w- 7.2 . 17 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.2 . 17 - 1 .w7 mod_php72w- 7.2 . 19 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.2 . 19 - 1 .w7 mod_php72w- 7.2 . 21 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.2 . 21 - 1 .w7 mod_php72w- 7.2 . 22 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.2 . 22 - 1 .w7 mod_php72w- 7.2 . 24 - 1 .w7.x86_64 : PHP module for the Apache HTTP Server Repo : webtatic Matched from: Provides : php = 7.2 . 24 - 1 .w7 php- 5.4 . 16 - 46 .el7.x86_64 : PHP scripting language for creating dynamic web : sites Repo : base php- 5.4 . 16 - 46.1 .el7_7.x86_64 : PHP scripting language for creating dynamic : web sites Repo : updates php55w- 5.5 . 38 - 1 .w7.x86_64 : PHP scripting language for creating dynamic web : sites Repo : webtatic Matched from: Provides : php = 5.5 . 38 - 1 .w7 php56w- 5.6 . 40 - 1 .w7.x86_64 : PHP scripting language for creating dynamic web : sites Repo : webtatic Matched from: Provides : php = 5.6 . 40 - 1 .w7 php70w- 7.0 . 33 - 1 .w7.x86_64 : PHP scripting language for creating dynamic web : sites Repo : webtatic Matched from: Provides : php = 7.0 . 33 - 1 .w7 |
#更新源
1 2 | rpm -Uvh https: //mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https: //mirror.webtatic.com/yum/el7/webtatic-release.rpm |
#移除系统自带的php-common
1 | yum remove php-common -y |
#安装依赖包
1 | yum install -y php72w php72w-opcache php72w-xml php72w-mcrypt php72w-gd php72w-devel php72w-mysql php72w-intl php72w-mbstring |
#版本变为7.2
1 | php -v |
显示以下结果
1 2 3 4 | PHP 7.2 . 24 (cli) (built: Oct 26 2019 12 : 28 : 19 ) ( NTS ) Copyright (c) 1997 - 2018 The PHP Group Zend Engine v3. 2.0 , Copyright (c) 1998 - 2018 Zend Technologies with Zend OPcache v7. 2.24 , Copyright (c) 1999 - 2018 , by Zend Technologies |
-----------------------有任何问题可以在评论区评论,也可以私信我,我看到的话会进行回复,欢迎大家指教------------------------
(蓝奏云官网有些地址失效了,需要把请求地址lanzous改成lanzoux才可以)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了