Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade PHP to 5.2.12 on CentOS using yum

I tried to find a simple way to upgrade PHP on my CentOS5 machine using yum instead of downloading the source and compiling it again myself (I did it last time, but it's really difficult to get all the compile configurations same as CentOS's default). Anyway, I finally use the methods listed here: http://www.atomicorp.com/wiki/index.php/PHP

Now, the command php -v shows the version is already 5.2.11 (which I needed) , but it always contains many warnings like:

PHP Warning:  PHP Startup: fileinfo: Unable to initialize   module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0

PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0

PHP Warning:  PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0

PHP Warning:  PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0

I think it basically means that I need to recompile these four modules, how could I do that? Any suggestions are appreciated.

like image 269
WilliamLou Avatar asked Nov 14 '22 13:11

WilliamLou


1 Answers

This is really easy, you need to add more upto date yum repository and then upgrade.

one example is here.


cat >> /etc/yum.repos.d/utterramblings.repo <<END
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL5/i386/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

After this you would get latest versions of php and other extensions. It works!!

like image 145
EGL 2-101 Avatar answered Dec 06 '22 12:12

EGL 2-101