VPS侦探论坛

 找回密码
 注册
查看: 11660|回复: 8

如何将lnmp 0.5里面的php5.2.14升级到php 5.3.3???

[复制链接]
发表于 2010-12-1 23:30:52 | 显示全部楼层 |阅读模式

如何将lnmp 0.5里面的php5.2.14升级到php 5.3.3???

~~~~~~~~~~~~~~~
注意:不要百度Google找到的教程发来 那个升级不了:::
CentOS5.3的php版本默认为5.1.6,然后在5.2.9版本之前的的php都存在一个漏洞,但是目前网上很多地方都无法使用yum update php*升级到5.2.9,比较常见的是升级到5.2.6版本的,经过搜索国外资料,现在终于找到一种升级CentOS的php到5.2.9的方法。
注意,此方法只能在官方的php版本上升级,如果你使用网上的升级到5.2.6版本的升级方法已经升级了,将无法使用本方法升级php。
运行下面命令:

wget http://download.fedora.redhat.co ... ease-5-3.noarch.rpm
wget http://rpms.famillecollet.com/en ... el5.remi.noarch.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

然后编辑/etc/yum.repos.d/remi.repo
#vi /etc/yum.repos.d/remi.repo
在这个文件的最后增加一行:
priority=1

保存退出。

/etc/yum.repos.d/epel.repo和/etc/yum.repos.d/epel-testing.repo这两个文件也按照上面的方法进行编辑!

使用下面的命令进行升级,但是经过测试,如果单独升级php将提示失败,只有联通mysql一起升级才可以,所以我们必须执行以下命令才能升级php到5.2.9版本:
yum –-enablerepo=remi update php* mysql*

PS: 这种方式 将 php 升级 到 5.3了


方法二 -------------------------------------------------------------------------------
或者 去 http://oss.oracle.com/
下再 php5.2的rpm包

方法三 -------------------------------------------------------------------------------


vim /etc/yum.repos.d/utterramblings.repo
输入
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

最后安装
yum install httpd php
现在我用的 就是通过 这种方式装的
php-5.2.11
httpd-2.2.14
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-12-2 10:06:07 | 显示全部楼层

回复 1# 的帖子



lnmp的是编译安装的,需要编译安装,参考lnmp脚本中php安装部分的就行了,里面对应的php、php-fpm、Suhosin都换成你要的版本。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-12-2 19:30:33 | 显示全部楼层

回复 2# 的帖子


不敢乱搞
老大能把脚本整理出来吗
那样真是太感谢啦
可以不?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-12-3 13:00:39 | 显示全部楼层



tar zxvf php-5.3.3.tar.gz
cd php-5.3.3/
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-fpm-user=www --with-fpm-group=www --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --with-mime-magic
make ZEND_EXTRA_LIBS='-liconv'
make install
安装的话基本就这些,php5.3.3与前的差别比较大,还有很多参数配置需要修改,可以找一下这方面的文章看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-12-4 01:27:01 | 显示全部楼层

郁闷  按照你的步骤操作后 无法重启/usr/local/php/sbin/php-fpm restart
只有按照你这个办法返回 5.2.14
重启/usr/local/php/sbin/php-fpm restart
还是依然提示::
[root@localhost memcache-2.2.5]# /usr/local/php/sbin/php-fpm restart
eAccelerator requires Zend Engine API version 220060519.
The Zend Engine API version 220090626 which is installed, is newer.
Contact eAccelerator at http://eaccelerator.net for a later version of eAccelerator.

Zend Optimizer requires Zend Engine API version 220060519.
The Zend Engine API version 220090626 which is installed, is newer.
Contact Zend Technologies at http://www.zend.com/ for a later version of Zend Optimizer.

PHP Warning:  PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
in Unknown on line 0
<br />
<b>Warning</b>:  Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>:  Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />
Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-y <file>]
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -h               This help
  -i               PHP information
  -m               Show compiled in modules
  -v               Version number
  -y, --fpm-config <file>
                   Specify alternative path to FastCGI process manager config file.

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2010-12-4 01:27:18 | 显示全部楼层

老大 看看是什么情况啊  
郁闷

[ 本帖最后由 lovegx999 于 2010-12-4 01:32 编辑 ]
 楼主| 发表于 2010-12-4 01:28:58 | 显示全部楼层

但指针里显示还是有memcache 的  郁闷
http://swisen.com/info.php
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-12-4 10:39:46 | 显示全部楼层

回复 7# 的帖子


php 5.3.3与现在的版本差异很大,安装新版后,原来lnmp的一些重启、开关的方法可能不一样了。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-12-5 20:18:14 | 显示全部楼层

回复 8# 的帖子



奇怪了
但我后来又使用上面的方法 重新编译了下php 5.2.14了
但怎么还是不行呢?

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-8 08:22 , Processed in 0.032151 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表