views:

1474

answers:

5

I tried to find a simple way to upgrade php on my centOS5 machine using yum instead of download the source and compile 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.

A: 

PHP is not installed all at once, it's modular. So you have things just like you listed that are designed for a different version of PHP. You will need to install all the plugins you are using for your implementation for the version of PHP you have installed.

Short answer, if you want a REALLY up to date PHP version, don't use CentOS. It's just a pain. CentOS is about stability, not cutting edge software. Use Ubuntu or Debian.

Long answer, your best option hands down is to compile from source or to find a repository that provides PHP 5.1.whatyouneed. I would advise against using a repository unless you are VERY sure that it comes from a reputable source.

If I was to do this I'd compile PHP from the source. Here is a link to get you started: http://www.wolflabs.org/2008/12/08/installing-php-from-source-on-centos-x86_64-w-apache/

Joe Mills
I agree with you. however, I have to stick with CentOS (it's the productions server environment, the developer's better to be the same). Actually, I just found out that I could use 'yum upgrade php-mssql php-mcrypt' to remove the warnings, but for other two, I don't which two modules I should call.
WilliamLou
ok. I figure it out, run: pecl upgrade fileinfo, memcache
WilliamLou
A: 

You should grab the SRPM, replace the tarball, and rebuild it. You may want to grab the "extras" SRPM as well if you need anything from it.

Ignacio Vazquez-Abrams
A: 

here is repo configuration I've used to upgrade PHP on CentOS 5 (look for Enterprise Linux 5 in the text) http://blog.famillecollet.com/pages/Config-en

Yaroslav
A: 

Try

pecl install fileinfo readline memcache

And this should fix the problem.

gvk
A: 

pecl install memcache

Worked for me running Centos 5.5

Farrand