如何在CentOS 6.5上升级PHP

<p>在更新PHP之前,先查看下当前PHP版本,避免重复的更新</p><pre class="brush:bash;toolbar:false">#php-v</pre><p><img src="/up_pic/201901/121100036046.jpg" title="121100036046.jpg" alt="1.jpg"/></p><p>检查当前PHP的安装包</p><pre class="brush:bash;toolbar:false">#yumlistinstalled|grepphp</pre><p><img src="/up_pic/201901/121100078768.jpg" title="121100078768.jpg" alt="2.jpg"/></p><p>移除当前PHP的安装包,否则容易起冲突</p><pre class="brush:bash;toolbar:false">#yumremovephp*</pre><p><img src="/up_pic/201901/121100119065.jpg" title="121100119065.jpg" alt="3.jpg"/></p><p>由于默认的YUM源无法升级PHP,所以需要添加第三方的YUM源,此处用到webtatic。</p><p>因为是CentOS 6.5,所以用以下URL</p><pre class="brush:bash;toolbar:false">#rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm</pre><p>如果是CentOS 7.x</p><pre class="brush:bash;toolbar:false">rpm-Uvhhttps://mirror.webtatic.com/yum/el7/epel-release.rpm rpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm</pre><p><img src="/up_pic/201901/121100163677.jpg" title="121100163677.jpg" alt="4.jpg"/></p><p>查看YUM源上能用PHP安装包</p><p># yum list php*</p><p><img src="/up_pic/201901/121100214975.jpg" title="121100214975.jpg" alt="5.jpg"/></p><p>安装PHP5.5及需要的扩展</p><pre class="brush:bash;toolbar:false">#yuminstallphp55wphp55w-develphp55w-commonphp55w-mysqlphp55w-pdophp55w-opacachephp55w-xml</pre><p><img src="/up_pic/201901/121100257772.jpg" title="121100257772.jpg" alt="6.jpg"/></p><p>7</p><p>再次查看PHP版本,以确认安装是否成功</p><p><img src="/up_pic/201901/121100314970.jpg" title="121100314970.jpg" alt="7.jpg"/></p><p>8</p><p>对了,如果你的PHP要用到Redis,请别忘了安装php-redis 扩展</p><pre class="brush:bash;toolbar:false">#yuminstallphp-redis</pre><p><img src="/up_pic/201901/121100377396.jpg" title="121100377396.jpg" alt="8.jpg"/>步骤阅读</p>
RangeTime:0.005851s
RangeMem:205.55 KB
返回顶部 留言