Upgrading to PHP 5.2.2 on RHEL and CentOS

May 5, 2007 by · 33 Comments 

It's been quite a while since the last release of PHP 5.2. The article I posted on upgrading to PHP 5.2.1 was published back on 2/10/2007, just short of 3 months ago. That all said, PHP 5.2.2 has finally been released and it includes many of the patches that were submitted under the recent "Month of PHP Bugs" (formerly known as "March").

The spec file goes largely unchanged from my release of 5.2.1, although the source has been updated to 5.2.2 and one RH-supplied patch (#50) has been updated to reflect some of the code changes in this newest release.

With more than 120 bugs fixed and additional improvements to memory management, needless to say, this is considered to be a fairly important release and I strongly suggest that any user of my yum repository take a few minutes and run a "yum update". If you're not using my repo, you should be, because it'll really make keeping your system up-to-date a lot easier (check out the "Yum Repository" link at the top of the page). If you're really adamant about not using my repo (perhaps you just want to upgrade PHP and not MySQL, httpd, etc.) or simply want to compile from source (why are you using an RPM-based distro then?), you may be interested in the src.rpm package at the bottom of the page.

PHP 5.2.2 Release Notes / ChangeLog

Update (9/24/2009): Packages deleted, use the yum repository instead.

Comments

33 Responses to “Upgrading to PHP 5.2.2 on RHEL and CentOS”
  1. Steve Eastland says:

    Thanks for providing these packages. We just installed all new servers and are running CentOS 4.4 on them. Previously we were running RHEL3 and I was compiling Apache and PHP from source every release and using the MySQL-provided community RPMs. Being able to use your repo makes life much much easier.

  2. wetwired says:

    Hi!
    I'm one of those people who need to recompile each new version of PHP even using RPM-based RedHat EL 4 & 5. The reason is lack of php-interbase module in default distribution and i need it to work with FirebirdSQL server. So it would be great to have this module precompiled in your repo and you'll make one (or maybe even more) man happier 🙂

  3. Jason says:

    I don't believe that that module is included in the default build (or mine) because Firebird isn't included in the RHEL/CentOS repos. It would create a dependency on something unavailable in the distribution.

    If I'm wrong and Firebird (or at least it's libraries: libgds, libib_util, and libfbclient) is included in the stock repo then let me know what the package name is and I'll build the module.

  4. ernie says:

    Does anyone else get errors like this:

    /usr/lib/mysql/libmysqlclient.a(zutil.o)(.data.rel.ro.local 0x0):/data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:28: first defined here
    /usr/lib/mysql/libz.a(zutil.o)(.text 0x0): In function `zlibVersion':
    /data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:28: multiple definition of `zlibVersion'
    /usr/lib/mysql/libmysqlclient.a(zutil.o)(.text 0x0):/data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:28: first defined here
    /usr/lib/mysql/libz.a(zutil.o)(.text 0x16): In function `zlibCompileFlags':
    /data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:33: multiple definition of `zlibCompileFlags'
    /usr/lib/mysql/libmysqlclient.a(zutil.o)(.text 0x16):/data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:33: first defined here
    /usr/lib/mysql/libz.a(zutil.o)(.text 0x20): In function `zError':
    /data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:135: multiple definition of `zError'
    /usr/lib/mysql/libmysqlclient.a(zutil.o)(.text 0x20):/data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:135: first defined here
    /usr/lib/mysql/libz.a(zutil.o)(.text 0x41): In function `zcalloc':
    /data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:304: multiple definition of `zcalloc'
    /usr/lib/mysql/libmysqlclient.a(zutil.o)(.text 0x41):/data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:304: first defined here
    /usr/lib/mysql/libz.a(zutil.o)(.text 0x68): In function `zcfree':
    /data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:313: multiple definition of `zcfree'
    /usr/lib/mysql/libmysqlclient.a(zutil.o)(.text 0x68):/data1/mysqldev/tmp-200704170906-5.0.40-13128/rpm/BUILD/mysql-5.0.40/zlib/zutil.c:313: first defined here

    I'm using the "official" 5.0.40 RPMs from MySQL, RH 4, latest updates.... I think its becuase MySQL uses its own zlib or something similar to that...

  5. ernie says:

    Also, it seems like if i move to that directory manually and run the last command that fails either without -lmysqlclient or -lz the command succeeds. But I'm not sure how to get the spec file to do that ...

  6. Jason says:

    @ernie,

    I'm a bit confused. The info above makes it look like you're trying to compile MySQL 5.0.40 but you've posted a comment on a page about PHP 5.2.2. In addition, while it looks like you're trying to compile MySQL, you've said that you are already using the "official" 5.0.40 RPMs. To my knowledge, there are no 5.0.40 RPMs unless you've got an Enterprise subscription, and in that case, you wouldn't be compiling from source anyway.

    What, exactly, is it that you are trying to do?

  7. ernie says:

    Oh, sorry, I should have re-thought that before I posted :). I've already got MySQL (yes 5.0.40, enterprise version) installed and working just fine. I downloaded your spec file, installed it, and just did a rpmbuild -bb php.spec, as usual. About halfway through the compile I get those errors (there are more, a lot more, I just didn't paste them all in). If I go to that directory and run a 'make', I get the same errors. If i copy and paste in the last compile command, and remove either '-lz' or -'-lmysqlclient', it compiles cleanly, but obviously thats done outside the rpm build environment, and the rpm won't get built...

  8. ernie says:

    Very odd, I sorted around it by hacking the /usr/bin/mysql_config file to not print '-lz' when it is giving its flags. This allowed me to compile the src rpm into PHP 5.2.2 RPMs just fine .... According to phpinfo, I have zlib support, so I'm not sure what was going on there. I read a few things on google about MySQL including their own zlib library. Hope this helps anyone else with this problem.

  9. Tony says:

    Jason,
    5.2 is supposed to have hooks for a upload progress extension and the extension is supposed to be part of the stock 5.2.x disto, however when i built 5.2.1 using your instructions the upload progress extension was no where to be found.
    Do you have any ideas on how to get this to compile? There must be a compiler option to enable it, but I have not found it yet.

    Thanks,

    Tony

  10. Jason says:

    In order to get progress data for file uploads you need to install the pecl extension "uploadprogress". You can do that by running the command "pecl install uploadprogress". Once you've done that, you'll need to edit your php.ini to load the extension. Finally, you'll need to create a hidden form element called "UPLOAD_IDENTIFIER" so that your progress calls know which upload to track.

  11. Tony says:

    Hi Jason,
    I did all that and I couldn't get it to work. I figured there was a compiler option that needed to be enabled when building PHP, it' very difficult to find any info on the upload progress hooks in 5.2

  12. Jason says:

    The info I posted came from http://www.php.net/features.file-upload and was found in the comment section.

    I've tried installing this myself and the only problem I ran into was that the "uploadprogress" extension is considered "beta", not "stable", so it wouldn't install unless I ran the command below.

    pecl install channel://pecl.php.net/uploadprogress-0.3.0

  13. Denis says:

    Error: Missing Dependency: libc-client.so.0 is needed by package php-imap

    How to fix this ?
    I tried with "yum install libc-client*" but "yum update php*" show the same error..
    Also "Error: Missing Dependency: libnetsnmp.so.5 is needed by package php-snmp" error.

  14. Jason says:

    libc-client.so.0 is part of "libc-client" and libnetsnmp.so.5 is part of the "net-snmp-libs" package. It sounds like you don't have either of those installed. Run "yum install libc-client net-snmp-libs" and then try updating PHP again.

  15. Denis says:

    Jason, thanx for reply. But:
    yum install libc-client net-snmp-libs
    Parsing package install arguments
    Nothing to do

    OS: FC6.

  16. Jason says:

    Denis,

    My repository is for users of RHEL & CentOS 4. FC6 provides libc-client.so.1, not libc-client.so.0, so you will not be able to use my RPMs. Likewise, FC6 provides libnetsnmp.so.10, not libnetsnmp.so.5.

    If you want to use PHP 5.2.2 then you would have to download my src.rpm and build that into FC6-compatible RPMs.

  17. Matt says:

    Any chance of getting a patch for the HTTP_RAW_POST_DATA PHP bug

    http://bugs.php.net/bug.php?id=41293

    Thanks!

  18. Jason says:

    I'd rebuild new binaries but there doesn't seem to be a patch attached to that bug fix. If you find one let me know and I'll certainly update the packages.

  19. tony says:

    what command line to upgrade php to 5.2.5? I'm now using CentOS 5 and PHP 5.1.6.

    anyone can guide with the correct command lines for the upgrade?

    thanks

  20. Jason says:

    @tony,

    I offer PHP 5.2.5 in my yum repository. Check out the link at the top of my site.

  21. tony says:

    thanks Jason!
    my situation is: I already have PHP 5.1.6 installed through YUM on my CentOS 5. I am wondering what commandlines I should use to upgrade to 5.2.5. I have downloaded the RPM package from you repository.

    Can you teach me how to upgrade? I have root access through SSH.

    thank you so much 😉

  22. tony says:

    should it be: #yum update php-5.2.5-jason.2.src.rpm ?

    but I got Error: Missing Dependency: freetds-devel is needed by package php from running that command line.

  23. Jason says:

    @tony,

    Once you've got my repository configured on your system the appropriate command would be "yum update php". That will also end up updating your httpd and some other minor stuff.

  24. EgyptPharaoh says:

    Man I am just posting BIG THANK YOU, your repo has moved a HUGE burden from my shoulders
    i swear when things works fine with me and i start make money I will support ur caffien
    but again thank you my life saver

  25. MaNowhere says:

    Hey Jason,
    Thanks a lot for your repository, I've just updated my Centos server with PHP 5.25. Can you explain what exactly is the installation process doing? Does yum install the php extension in Apache as a DSO or does it embed the php extension in the httpd binary?
    Can you please tell me how can I figure that out?

    One more thing, how can I 'downgrade' the php version from 5.25 to 5.24 using yum, and reconfigure apache with the downgraded version?
    Thanks!

  26. Jason says:

    @MaNowhere,

    Not really sure what you're asking about the install process... PHP is loaded into httpd as a module using the /etc/httpd/conf.d/php.conf config file. This is a fairly standard practice.

    As to downgrading, why would you want to do that? I don't believe yum has a downgrade feature so you'd need to remove 5.2.5 and then install 5.2.4 by including the version number in your "yum install ..." command. Oh, and 5.2.6 is now available.

  27. Diogo Serra says:

    I have run "yum update php" :
    (after checking all dependencies ....)
    Error: Missing Dependency: httpd-mmn = 20020903 is needed by package mod_dav_svn
    Error: Missing Dependency: libapr-0.so.0 is needed by package subversion
    Error: Missing Dependency: libaprutil-0.so.0 is needed by package subversion

    I really need to keep subversion on this machine (CENTOS 4.4), cloud you help me , what should i do ?

    Thank you

  28. Brad Wood says:

    Hi Jason,

    Like Diogo, I'm getting:

    Error: Missing Dependency: httpd-mmn = 20020903 is needed by package mod_auth_kerb
    Error: Missing Dependency: httpd-mmn = 20020903 is needed by package mod_auth_mysql
    Error: Missing Dependency: httpd-mmn = 20020903 is needed by package mod_auth_pgsql
    Error: Missing Dependency: httpd-mmn = 20020903 is needed by package mod_authz_ldap

    When running "yup update php"

    Should I remove the httpd package(s) and re-install from your repo?

    Cheers

    Brad

  29. Jonh says:

    Thanks!I have success to update my php to version 5.2.6 !

  30. Bryan says:

    Hi Jason,

    First off, thanks for providing this service. It is a BIG help.

    I just wanted to ask for your help to point me to how I can enable the PDO extensions for PHP 5.2. I'm fairly new to RHEL5 so anything would be a tremendous help.

  31. Bryan says:

    I've managed to get PDO installed. There's one last extension that's failing on me and it's a dependency issue. I'd like to ask for your advice on how I might solve this problem.

    # yum install php-mcrypt
    Loading "rhnplugin" plugin
    Loading "security" plugin
    rhel-x86_64-server-supple 100% |=========================| 1.2 kB 00:00
    rhel-x86_64-server-vt-5 100% |=========================| 1.2 kB 00:00
    rhel-x86_64-server-5 100% |=========================| 1.2 kB 00:00
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-mcrypt.x86_64 0:5.2.6-jason.1 set to be updated
    --> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt
    --> Finished Dependency Resolution
    Error: Missing Dependency: libmcrypt.so.4()(64bit) is needed by package php-mcrypt

    Thank you.

  32. Tobias says:

    Well I set up a new RHEL5 machine and tried installing php with your repository but I also can't install php-mcrypt (32 bit tho). Same problem that libmcrypt.so.4 is missing 🙁

  33. Tobias says:

    Ok my error - I did not enable DAG repository! stupid me

This site is no longer updated. If you have a need for RHEL/CentOS LAMP Stack updates outside the normal channels, I recommend ART. https://updates.atomicorp.com/channels/