Centos 6.x/7.x yum安装php5.6.X(最新版)
鉴于Centos 默认yum源的@R_301_461@版本太低了,手动编译安装又有点一些麻烦,那么如何采用Yum安装的方案安装最新版呢。那么,今天我们就来学习下如何用yum安装@R_301_461@最新版。
1.检查当前安装的@R_301_461@包
[plain]view plaincopy
yumlistinstalled|grep@R_301_461@
[html]copy
yumremove@R_301_461@.x86_64@R_301_461@-cli.x86_64@R_301_461@-common.x86_64@R_301_461@-gd.x86_64@R_301_461@-ldap.x86_64@R_301_461@-mbstring.x86_64@R_301_461@-mcrypt.x86_64@R_301_461@-MysqL.x86_64@R_301_461@-pdo.x86_64
配置yum源
追加CentOS 6.5的epel及remi源。
1
2
|
#rpm-Uvhhttp:
//ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
//rpms.famillecollet.com/enterprise/remi-release-6.rpm
|
以下是CentOS 7.0的源。
2
|
#yuminstallepel-release
#rpm-ivhhttp:
//rpms.famillecollet.com/enterprise/remi-release-7.rpm
|
使用yum list命令查看可安装的包(Packege)。
1 |
安装@R_301_461@5.6.x
yum源配置好了,下一步就安装@R_301_461@5.6。
如下 :yuminstall--enablerepo=remi--enablerepo=remi-@R_301_461@56@R_301_461@@R_301_461@-opcache@R_301_461@-devel@R_301_461@-mbstring@R_301_461@-mcrypt@R_301_461@-MysqLnd@R_301_461@-@R_301_461@unit-@R_301_461@Unit@R_301_461@-pecl-xdebug@R_301_461@-pecl-xhprof
用PHP命令查看版本。
2
3
4
5
6
|
#@R_301_461@--version
@R_301_461@5.6.0(cli)(built:Sep3201419:51:31)
Copyright(c)1997-2014The@R_301_461@Group
ZendEnginev2.6.0,Copyright(c)1998-2014ZendTechnologies
withZendOPcachev7.0.4-dev,Copyright(c)1999-2014,byZendTechnologies
withXdebugv2.2.5,Copyright(c)2002-2014,byDerickRethans
|
安装@R_301_461@-fpm
[html]
yuminstall--enablerepo=remi--enablerepo=remi-php56php-fpm 在这里安装的版本是PHP5.6.13。 从PHP5.5开始PHP代码缓存从APC变成了Zend OPcache了。 其他源: 2.Centos 5.X rpm-Uvhhttp://mirror.webtatic.com/yum/el5/latest.rpm 如果想删除上面安装的包,重新安装 yuminstallphp55w.x86_64php55w-cli.x86_64php55w-common.x86_64php55w-gd.x86_64php55w-ldap.x86_64php55w-mbstring.x86_64php55w-mcrypt.x86_64php55w-mysql.x86_64php55w-pdo.x86_64 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 yum install php55w-fpm 最后,让我们来测试下 Nginx 是否能处理 @R_301_461@ 页面。在测试之前,请确保重启 Nginx 和 @R_301_461@-FPM。 在 CentOS 7 系统上: 在 CentOS 6 系统上: 创建一个叫名叫 test.@R_301_461@ 的文件,然后写入如下内容,并放入 /var/www/html/ 目录。 打开浏览器,输入 http://Nginx的IP地址/test.@R_301_461@ 。 如果您能看到如上所示的页面,说明设置的 LEMP 完全成功! 转载地址 :http://blog.csdn.net/zhaozuosui/article/details/48394409
CentOs6.x
rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm
CentOs7.X
rpm-Uvhhttps://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm
rpm -qa | grep webstatic
rpm -e 上面搜索到的包即可
3.运行yum install
注:如果想升级到5.6把上面的55w换成56w就可以了。
4.安装PHP FPM
注:如果想升级到5.6把上面的55w换成56w就可以了。成功在望:测试 PHP
$sudosystemctlrestartNginx
$sudosystemctlrestart@R_301_461@-fpm
$sudoserviceNginxrestart
$sudoservice@R_301_461@-fpmrestart
<?@R_301_461@@R_301_461@info();?>