Webtatic.com

Just another technical blog

PHP 5.3 on CentOS 5

Posted 20th June 2009 by Andy | 106 Comments

My previous articles on installing PHP on CentOS dealt with installing PHP 5.2.6. I have found this to have some bugs that kill the process without error information. One bug I found, which was on an x86_64 server, was that converting an object to a string did this.

So, I have compiled the latest PHP version, 5.2.10 5.3.0 5.3.2, and put it in my own repository for easy installation. I have compiled it for CentOS 5 i386 and x86_64, and provided the source RPMS in the repo, if anyone wants to compile it for another OS or architecture.

Update 2009-07-03 – I updated the version to PHP 5.3, which was released a few days before. This includes many new features such as closures, namespaces, and packaged scripts in phar files, which I’ll blog about soon. Check out PHP changelog for more details.
Update 2009-09-01 – Added a note about deprecated errors, and how to silence them. Also I have included a tip that might help those of you struggling to install.
Update 2010-03-03 – I’ve added both apc 3.1.3p1 beta (php-pecl-apc in yum) and eAccelerator 0.9.6 (php-eaccelerator in yum) RPMs to the repository, they are compiled for (and work on) php 5.3.x

I have also included the same php extensions I mentioned in my other article, php-mcrypt, php-mhash (in PHP 5.2), php-mssql and php-tidy

To install, first you must tell rpm to accept rpm’s signed by me, then add the yum repository information to yum:

rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm

Now you can install php by doing:

yum --enablerepo=webtatic install php

Or update an existing installation of php, which will also update all of the other php modules installed:

yum --enablerepo=webtatic update php

If this does not work correctly, try disabling all other repositories while installing/updating, by adding the –disablerepo=* option. This will stop other dependencies from being installed, so you may want to install them first.

yum --disablerepo=* --enablerepo=webtatic update php

“Depsolving” problems

If you get depsolving problems when updating, you may have currently installed some extensions that have been removed, e.g. php-mhash, php-ncurses.

You will need to remove them before upgrading.

yum remove php-mhash php-ncurses

Deprecated Errors

Once you are running the new version, you may get “deprecated” errors in your error logs. This isn’t bad, it just means to tell you that some of the functions you are using are no longer prefered, and may be removed in a future major release. An example of this is the ereg functions. Preg functions are prefered over these, as they are much faster and more powerful, and in all cases do at least the same thing.

If upgrading the functions are not an option, and you would like to hide the deprecated errors from your error log, for example on a production server, just edit your /etc/php.ini file, find the line:

error_reporting  =  E_ALL

and replace to:

error_reporting  =  E_ALL & ~E_DEPRECATED

PHP 5.2.13

I am also maintaining a PHP 5.2.13 release, so should you prefer to install that (for reasons like incompatibilities or testing), you can force it to install that instead by doing:

yum --enablerepo=webtatic --exclude=php*5.3* update php

Or you can add to the /etc/yum.repos.d/webtatic.repo the line:

exclude=php*5.3*

Related Posts

106 Responses to “PHP 5.3 on CentOS 5”

  1. Matt says:

    Thanks for this!

  2. Andy says:

    Noticed Fedora 11 has a version of php 5.2.9, so I built a new version based on that (a few modifications were needed for CentOS), and put it in the repo.

    This version has the additional patches that Fedora added, and comes in a single source RPM. There are a few additonal RPMs as well, such as a ZTS (Zend Thread Safety) compilation which will work better on Httpd Worker mpm.

  3. iNoize says:

    Hmm got some Trouble
    php-gd-5.2.10-4.x86_64 from webtatic has depsolving problems
    –> Missing Dependency: libt1.so.5()(64bit) is needed by package php-gd-5.2.10-4.x86_64 (webtatic)
    Error: Missing Dependency: libt1.so.5()(64bit) is needed by package php-gd-5.2.10-4.x86_64 (webtatic)

  4. Aurelian says:

    –> Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-4.i386 (webtatic)
    Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-4.i386 (webtatic)

    Why do i get this error?! I have installed CENTOS using

    http://www.howtoforge.com/perfect-server-centos-5.3-i386-ispconfig-2

    As tutorial. I’m complete newbie in LINUX. Please guide me through this.

  5. Andy says:

    Sorry, it appears to be a rpm dependency that was missing in Fedora’s spec file I used. I’ve compiled new i386 and x64 binaries that have the correct dependencies, so you should just be able to attempt again and it’ll work.

    I’ll try mentioning it to them, as it must be an issue on Fedora as well. The base install may include the package or something though.

  6. Joseph says:

    First off, thanks for providing these packages! I’ve just installed PHP 5.3.0 on CentOS 5.3 and it is working great!

    However, when trying to install php-gd I get an error similar to what Aurelian is reporting above:

    php-gd-5.3.0-1.i386 from webtatic has depsolving problems
    –> Missing Dependency: libt1.so.5 is needed by package php-gd-5.3.0-1.i386 (webtatic)
    php-gd-5.3.0-1.i386 from webtatic has depsolving problems
    –> Missing Dependency: t1lib is needed by package php-gd-5.3.0-1.i386 (webtatic)
    Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.3.0-1.i386 (webtatic)
    Error: Missing Dependency: t1lib is needed by package php-gd-5.3.0-1.i386 (webtatic)

    Any ideas?

  7. Andy says:

    right, figured out the problem, t1lib was part of rpmforge’s repository (I always set that one up as it has a few extra packages I use)

    I’ve removed the t1lib dependency and recompiled a new version of 5.3.0, so you can install/update to that and it should work fine.

  8. Hamid says:

    Andy, thanks for providing help and yum sources. However, after doing “yum –enablerepo=webtatic update php”, I get:

    –> Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
    Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)

    I am doing this on CentOS 5.2 64-bit for PHP 5.3 although I would be happy with PHP 5.2.10. Is your solution expected to work for me?

    • Andy says:

      Hi Hamid,

      PHP 5.3 actually contains the fileinfo extension as part of its default extensions.

      You can remove the pecl extension and the rpms will install the fileinfo extension as part of the base php-common package.

    • Hamid says:

      Hi Andy. Thanks for the guidance. I did:

      yum remove php-pecl-Fileinfo.x86_64

      ran PHP 5.3’s ./configure, make, make test & make install. php -v gives tons of errors relating to shared extensions written to /usr/lib/20090626 instead of the 64-bit one defined in /usr/lib64/php/modules.

      Is there any hope in building PHP 5.3.0 on Centos 5.2-64?

    • Andy says:

      sorry I don’t understand why you are building PHP 5.3? The repo contains that version, so you don’t need to compile.

  9. Hamid says:

    Andy, I have tried yum upgrade php.x86_64 & yum update php.x86_64 to no avail. Also, I tried yum upgrade of most other php packages installed:
    php.x86_64
    php-cli.x86_64
    php-common.x86_64
    php-dba.x86_64
    php-devel.x86_64
    php-gd.x86_64
    php-imap.x86_64
    php-ldap.x86_64
    php-mbstring.x86_64
    php-mysql.x86_64
    php-odbc.x86_64
    php-pdo.x86_64
    php-pear.noarch
    php-pear-DB.noarch
    php-pear-Date.noarch
    php-pecl-Fileinfo.x86_64
    php-tidy.x86_64
    php-xml.x86_64

    which result in “No Packages marked for Update”.

    I have your repo in my repo list. Can you point me in the right direction?

    Many thanks, Andy.

  10. Andy says:

    hmm, my .repo file seems to act funny with the source repo definition in. I’ve deleted that part, so if you re-download it, yum should work better.

    all you should have to do is:
    yum –enablerepo=webtatic update php

  11. Hamid says:

    Andy, now it’s at least trying:

    #yum –enablerepo=webtatic update php

    –> Processing Dependency: php-api = 20041225 for package: php-pecl-Fileinfo
    –> Processing Dependency: php-api = 20041225 for package: php-pecl-memcache
    –> Finished Dependency Resolution
    php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 from installed has depsolving problems
    –> Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
    php-pecl-memcache-2.2.3-1.el5_2.x86_64 from installed has depsolving problems
    –> Missing Dependency: php-api = 20041225 is needed by package php-pecl-memcache-2.2.3-1.el5_2.x86_64 (installed)
    Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-memcache-2.2.3-1.el5_2.x86_64 (installed)
    Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)

    except that I already have php-pecl-memcache installed:

    # yum install php-pecl-memcache.x86_64
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: http://www.cyberuse.com
    * updates: mirror.anl.gov
    * addons: mirror.raystedman.net
    * extras: http://www.cyberuse.com
    Setting up Install Process
    Parsing package install arguments
    Package php-pecl-memcache-2.2.3-1.el5_2.x86_64 already installed and latest version
    Nothing to do

    I don’t even see your repo in the list.

    • Andy says:

      Sorry Hamid, I haven’t built any of CentOS’s php-pecl-* packages with PHP 5.3.

      It probably would be a good idea to, so I’ll try and sort that out soon, but in the meantime the only alternative is to uninstall all of them and “pecl install memcache” yourself. Fileinfo is already contained in the php packages, so you wont need to manually compile that.

    • Hamid says:

      Thank you kindly Andy.

  12. Chip says:

    Thanks a ton, Andy! This was a huge help.

  13. Klaus says:

    Great work! Thanks for the great packages, Andy. Really appreciated.

    Any chance you can provide a package with curl? Thanks! :)

  14. TonyG says:

    My current php version is “5.1.6-20.el5_2.1″. I followed the instructions and got the following error, what can I do to resolve?:

    ….
    —> Package php-ncurses.i386 0:5.2.10-5 set to be updated
    –> Processing Dependency: php-common = 5.2.10-5 for package: php-ncurses
    —> Package php-snmp.i386 0:5.3.0-3 set to be updated
    —> Package php-pdo.i386 0:5.3.0-3 set to be updated
    —> Package php-mysql.i386 0:5.3.0-3 set to be updated
    —> Package php-imap.i386 0:5.3.0-3 set to be updated
    —> Package php-xml.i386 0:5.3.0-3 set to be updated
    –> Finished Dependency Resolution
    Error: Missing Dependency: php-common = 5.2.10-5 is needed by package php-ncurses

  15. Andy says:

    @Klaus – php-curl is provided by the php-common package which should already be installed as it is a dependency of the php package, if that’s what you mean?

    @TonyG – php-ncurses was removed from php’s distribution in 5.3, however you could “yum remove php-ncurses”, and “pecl install ncurses” when you’ve upgraded php, as it should be in pecl’s repository.

  16. brian says:

    I have been able to install the 5.2.10 packages from your repo, which is great, but I am also trying to use your mhash and mcrypt packages. They seem to have installed correctly, however they do not show up in phpinfo() when run through apache. They DO show up if phpinfo() is run from the command line “php” command. Any ideas?

    I’m using CentOS 5.3 32-bit.

    • Andy says:

      The only situation I’d expect that to occur would be if you haven’t reloaded apache, sorry if you have already.

  17. brian says:

    I have reloaded apache and found these messages in the error log:
    PHP Warning: PHP Startup: mcrypt: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0
    PHP Warning: PHP Startup: mhash: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0

    This is my apache version: httpd-2.2.3-22.el5.centos.1

  18. Michael Mansour says:

    Hi Andy. I’ve just used your 5.2.10 RPM’s on Scientific Linux 5.3 (RHEL 5 derivative like CentOS).

    They installed fine.

    I used to use the Jason Litka’s (utterramblings) RPM’s for php 5.2.6 but he hasn’t updated in a long time. I have also tried remi which wouldn’t install without upgrading MySQL 5.0.45 to 5.1.x.

    I’m glad your php 5.2.10 installs without the problems above.

    However, one really good php module supplied by utterramblings is the php-xcache module, which is the php accelerator, one of the fastest open source ones around.

    Could you compile this into your repo please?

    I found a src rpm here:

    http://yum.aclub.net/pub/linux/centos/5/umask/SRPMS/

    I’m also wondering how with yum, you can tell it not to list the php 5.3.0 RPM’s on a yum list (or yum check-update) and concentrate only on the 5.2.x series?

    Lastly, I wouldn’t mind emailing you directly outside of these comments sections but I couldn’t find an email address for you.

    Could you email me please as I have some questions which aren’t really suitable for these comments.

    Thanks for providing all this btw, you’re a life saver.

    • Andy says:

      Updated the article to show how to install just the PHP 5.2.10 version.

      @Michael Thanks, I’ve sent you an email.

  19. Toby says:

    Hi there,

    Great article, thanks for posting this. Would I be able to use your repository to add php-devel to my PHP 5.2.9 installation?

    Cheers,

    Toby

    • Andy says:

      Hi Toby,

      I’d recommend upgrading to php 5.2.10, which is in this repository, including its php-devel package, as it is only a bugfix release, and shouldn’t have incompatibilities with my previous php 5.2.9 release.

      I’d rather not maintain multiple bugfix releases, as there is a lot of overhead in having to recompile them with additional patches.

    • Toby says:

      Ok Andy, thanks for the tip, I’ll give it a try!

      Best wishes,

      Toby

  20. Toby says:

    Hi Andy,

    Sorry to bother you again. Trying to upgrade to 5.2.10 as suggested gives me a similar missing dependency to that mentioned by Joseph above:

    php-gd-5.2.10-5.i386 from webtatic has depsolving problems
    –> Missing Dependency: t1lib is needed by package php-gd-5.2.10-5.i386 (webtatic)
    php-gd-5.2.10-5.i386 from webtatic has depsolving problems
    –> Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-5.i386 (webtatic)
    Error: Missing Dependency: t1lib is needed by package php-gd-5.2.10-5.i386 (webtatic)
    Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-5.i386 (webtatic)

    Is there anything I can do to work around this? And presumably if I can get this to work I then just do an install of php-devel from your repository?

    Thanks again,

    Toby

  21. Toby says:

    Hi Andy,

    I’m really sorry to keep bugging you, it seems unfair given all your good work! Having upgraded to 5.2.6 it ’seems’ to have toasted my install. My Apache error_log now shows this on restart:

    PHP Warning: PHP Startup: bcmath: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nTh$
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/curl.so’ – /usr/lib/php/modules/curl.so: undefined symbol: file_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/dbase.so’ – /usr/lib/php/modules/dbase.so: undefined symbol: core_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/gd.so’ – /usr/lib/php/modules/gd.so: undefined symbol: core_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/json.so’ – /usr/lib/php/modules/json.so: undefined symbol: executor_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mbstring.so’ – /usr/lib/php/modules/mbstring.so: undefined symbol: sapi_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysql.so’ – /usr/lib/php/modules/mysql.so: undefined symbol: executor_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysqli.so’ – /usr/lib/php/modules/mysqli.so: undefined symbol: executor_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo.so’ – /usr/lib/php/modules/pdo.so: undefined symbol: executor_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo_mysql.so’ – /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo_sqlite.so’ – /usr/lib/php/modules/pdo_sqlite.so: undefined symbol: executor_globals in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/zip.so’ – /usr/lib/php/modules/zip.so: undefined symbol: executor_globals in Unknown on line 0

    and phpinfo() is missing a bunch of sections (including mysql, bcmath etc).

    Any idea what’s happened? Should I/can I roll back to the previous version?

    Sorry to pester you with so many questions, I’m far from the Linux ninja I should be.

    Toby

  22. Tom says:

    Thank you for providing these packages!!

    I am trying to use this to install lilac and it’s saying “PHP’s POSIX support is not available. POSIX support is required for the importer/exporter/autodiscovery to function”

    Was this compiled with “–disable-posix” or is there something else wrong?

    • At some point fedora split off the posix and other process extensions from the base install, you can install it doing “yum install php-process”

    • Tom says:

      Andrew,

      Thank you so much. That was what I needed.

      Tom

    • Lawal Adekunle says:

      @ Andrew Thompson. Thanks so much for your post. You saved ma a whole lot of headache. i was installing centreon and it kept giving me Critical: php-posix functions are not installed. Now its Solved thanks a lot

  23. Matt Farmer says:

    Hey Andy,

    Thanks for putting this all together. I’m also running into dependency issues with php-common.

    # yum –enablerepo=webtatic update php

    –> Finished Dependency Resolution
    php-ncurses-5.2.10-6.i386 from webtatic has depsolving problems
    –> Missing Dependency: php-common = 5.2.10-6 is needed by package php-ncurses-5.2.10-6.i386 (webtatic)
    sb-publish-3.0.1-200705230939.noarch from installed has depsolving problems
    –> Missing Dependency: any-php-sqlite2 is needed by package sb-publish-3.0.1-200705230939.noarch (installed)
    php-mhash-5.2.10-6.i386 from webtatic has depsolving problems
    –> Missing Dependency: php-common = 5.2.10-6 is needed by package php-mhash-5.2.10-6.i386 (webtatic)
    Error: Missing Dependency: php-common = 5.2.10-6 is needed by package php-mhash-5.2.10-6.i386 (webtatic)
    Error: Missing Dependency: any-php-sqlite2 is needed by package sb-publish-3.0.1-200705230939.noarch (installed)
    Error: Missing Dependency: php-common = 5.2.10-6 is needed by package php-ncurses-5.2.10-6.i386 (webtatic)

    • Hi Matt,

      Try “yum update –enablerepo=webtatic php*”. Possibly it’s trying to satisfy dependencies without upgrading them.

      Also your output says something about “sb-publish”, which doesn’t look like it works with it.

  24. Matt Farmer says:

    Thanks for your reply Andy,

    That command gives a very similar reply. Could it be because the extensions in your repository are version 5.2.10-6 and not 5.3.0?

    # yum list –enablerepo=webtatic php-mhash*
    –snip–
    Installed Packages
    php-mhash.i386 5.2.6-1.el5.art installed
    Available Packages
    php-mhash.i386 5.2.10-6 webtatic

    • @Matt
      PHP 5.3 made mhash obsolite, and moved its functionality into php-hash which is installed by default.

      I’ll compile a new version of 5.3 with the correct obsolite’s

  25. Thanks a lot this worked like a charm on my CentOS 5.3 installation.

  26. Chas says:

    Hmm the 5.4.10 seems have have broken some extensions and phpmyadmin

    error_log:
    Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysqli.so’ – /usr/lib/php/modules/mysqli.so: undefined symbol: executor_globals in Unknown on line 0

    Linux yn 2.6.16.38-xenU #2 SMP Wed Aug 13 21:03:44 EDT 2008 i686 i686 i386 GNU/Linux

    I installed the glibc compatability libraries but that didn’t help

    suggestions? I’m rolling back for now – Chas.

  27. waynem says:

    I installed the PHP 5.3 on a Centos 5.3 unit, and it loaded and installed great, however, I needed to use either Zend or Ioncube with my software, and neither products have a PHP 5.3 compatible product. They will however work with PHP 5.2.10 I tried to re-install your 5.2.10 version, but it gives errors stating that no files were marked for “upgrade”. Probably because they are now 5.3 version, and 5.2.10 would be a “rollback” in versions. How can I rollback your PHP 5.3 upgrade and then install the 5.2.10 version ??

    I am sure others will also run into this problem.

    Thanks,
    Wayne

  28. Sorry about the 5.2.10 version not working before. I rebuilt exactly the same spec on another server and it now works.

    As for downgrading, there doesn’t seem to be any easy way other than to “yum remove php*” then install again with the exclude (the yum-allowdowngrade plugin doesn’t seem to work), .

  29. waynem says:

    The removal worked great, however, when I now try to update ( or “install” ) to the 5.2.10 version with the –exclude=*5.3* tag I get that I am missing dependencies for php-common = 5.2.10-6.1 and php-cli = 5.2.10-6.1 !!!

    And the “update” will not load these dependencies.

    Is there anyway to load these separately, so the php-5.2.10 version will load and run properly ?

    Thanks again,
    Wayne

  30. waynem says:

    I was able to manually re-install the 5.2.10 versions using your RPMs and all is well.

    Thank you,
    Hopefully Zend and ION cube will get their act together and we can then upgrade to the 5.3 version.

    Wayne

  31. rhino says:

    Nice work! I was able to update my centos5 box to php5.3 when remi’s repo was missing a dependency…yours worked like a champ. Thanks!

  32. Kevin Lane says:

    Hi. I was having the same issue with no updates found until I realized that the version of CentOS I installed had priorities enabled by default. I had to put: priority=1 into your repo to make it find the updates.

    Thanks for this page though as it helped a lot.

  33. Alex W says:

    Although Andrew has already said it, I’m going to repeat that if you are missing packages, you can download and individually install them from here

    http://repo.webtatic.com/yum/centos/5/i386/

    With the 5.2.10 install, I found that mcrypt wasn’t being installed when I did

    yum –enablerepo=webtatic –exclude=php*5.3* update php

    but I was able to download it and install it manually afterwards

    (and thanks Andrew, you’ve been a life saver)

  34. [...] installing php5.3 with xml support on centos [...]

  35. Camulos says:

    thanx so much! I was looking for this :) ( PHP 5.2.10 !!)

  36. Alex says:

    You’re a life saver. One thing you have to add is XCache 1.3.0 which supports PHP 5.3. I dug up your email addy and I’ll email you the srpm.

    Thanks!
    Alex

  37. Deep says:

    Hi Andy,

    I managed to upgrade my PHP from 5.1.6 to 5.2.10. But then I wanted to install imap.

    I did yum install php-imap, which surprisingly looking at the older version

    [root@00:16:3e:69:96:bf-my00001 yum.repos.d]# yum install php-imap
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * epel: mirror.nus.edu.sg
    * updates: mirror.nus.edu.sg
    * base: mirror.nus.edu.sg
    * addons: mirror.nus.edu.sg
    * extras: mirror.nus.edu.sg
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    –> Running transaction check
    —> Package php-imap.x86_64 0:5.1.6-23.2.el5_3 set to be updated
    –> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-imap
    –> Processing Dependency: libc-client.so.1()(64bit) for package: php-imap
    –> Running transaction check
    —> Package php-imap.x86_64 0:5.1.6-23.2.el5_3 set to be updated
    –> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-imap
    —> Package libc-client.x86_64 0:2004g-2.2.1 set to be updated
    –> Finished Dependency Resolution
    php-imap-5.1.6-23.2.el5_3.x86_64 from updates has depsolving problems
    –> Missing Dependency: php-common = 5.1.6-23.2.el5_3 is needed by package php-imap-5.1.6-23.2.el5_3.x86_64 (updates)
    Error: Missing Dependency: php-common = 5.1.6-23.2.el5_3 is needed by package php-imap-5.1.6-23.2.el5_3.x86_64 (updates)

    I tried to run the rpm directly from your server:

    # rpm -i http://repo.webtatic.com/yum/centos/5/x86_64/php-imap-5.2.11-1.x86_64.rpm

    but this is giving me error:

    error: Failed dependencies:
    libc-client.so.1()(64bit) is needed by php-imap-5.2.11-1.x86_64

    Need your help.

    Thanx in advance.

    Regards,
    Deep

    • Hi Deep,

      You need to set the enablerepo flag whenever you install any packages that depend on my version, e.g.
      yum install –enablerepo=webtatic php-imap

      Also the reason the rpm -i failed was because rpm on its own doesn’t resolve dependencies. You would need to install the dependency beforehand.

      You can lookup the package that the dependency is in by doing:
      yum provides libc-client.so.1

      In this case its libc-client, but names aren’t always the same.

  38. [...] only has PHP 5.1 in it’s repository but Andy Thomson is hosting a 5.3 repo at Webtatic.com with a step by step guide on installing it from fresh or [...]

  39. John says:

    Hi, I think I’ve everything set up! Thankyou for your great job!

    I’m just missing the php_mysql.so : where can I find it?

  40. Jonathan Lambert says:

    http://us2.php.net/manual/en/pcre.installation.php

    It looks like you compiled PCRE support without –enable-utf8… this breaks frameworks like Kohana, which require it. Not sure how to fix this without recompiling (which is what I did) from source.

    I might suggest it. :)

    TY for your efforts!

    • Interesting, I only really modified the Fedora PHP package, so it only has the configure options that that adds.

      Maybe though PHP 5.3 acts differently with this option and I need to add it. I’ll have a look later next week.

  41. Aigini says:

    Hi,

    I tried installing php as per directions set above, but when I enter the last line, which is :

    yum –enablerepo=webtatic install php

    I receive the following error :

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * epel: mirror.nus.edu.sg
    * base: mirror.averse.net
    * updates: centosw.centos.org
    * addons: centos.mirror.aussiehq.net.au
    * extras: centos.mirror.aussiehq.net.au
    http://mirror.nus.edu.sg/fedora/epel/5/x86_64/repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2: [Errno 12] Timeout:
    Trying other mirror.
    http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/5/x86_64/repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2: [Errno 12] Timeout:
    Trying other mirror.
    http://ftp.kddilabs.jp/Linux/packages/fedora/epel/5/x86_64/repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2: [Errno 12] Timeout:
    Trying other mirror.
    http://mirror.yandex.ru/epel/5/x86_64/repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
    Trying other mirror.
    http://ftp.rhd.ru/pub/epel/5/x86_64/repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2: [Errno 12] Timeout:
    Trying other mirror.
    http://ftp.riken.jp/Linux/fedora/epel/5/x86_64/repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2: [Errno 12] Timeout:
    Trying other mirror.
    http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora/epel/5/x86_64/repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2: [Errno 12] Timeout:
    Trying other mirror.
    Error: failure: repodata/404fea18faa41c16ced386457971aee99ea3e69f-primary.sqlite.bz2 from epel: [Errno 256] No more mirrors to try.

    Pls help me solve this.

    • Andy says:

      It looks like one of your other yum repositories isn’t working. You can bypass it doing:
      yum --disablerepo=epel --enablerepo=webtatic install php

  42. Aigini says:

    So I tried replacing that line with :

    yum –disablerepo=* –enablerepo=webtatic update php

    This was the final output :

    Downloading Packages:
    (1/4): php-ldap5.3.0-4.1.x86_64.rpm | 66 kB 00:00
    http://repo.webtatic.com/yum/centos/5/x86_64/php-common 5.3.0-4.1.x86_64.rpm: [Errno 12] Timeout:
    Trying other mirror.
    http://repo.webtatic.com/yum/centos/5/x86_64/php-cli-5.3.0-4.1.x86_64.rpm: [Errno 12] Timeout:
    Trying other mirror.
    (4/4): php-5.3.0-4.1.x86_64.rpm | 5.3 MB 15:32
    —————————————————————————————————————————–
    Total 9.7 kB/s | 9.8 MB 17:13

    Error Downloading Packages:
    php-cli-5.3.0-4.1.x86_64: failure: php-cli-5.3.0-4.1.x86_64.rpm from webtatic: [Errno 256] No more mirrors to try.
    php-common-5.3.0-4.1.x86_64: failure: php-common-5.3.0-4.1.x86_64.rpm from webtatic: [Errno 256] No more mirrors to try.

  43. Hans Rakers says:

    Works like a charm! Thanks for your efforts!

  44. Roger Walker says:

    I recently installed your 5.3.0 RPMS on a CentOS 5.x system. I am using the ‘open_basedir’ setting in the website’s vhosts config to keep things within the website directory (and subdirectories). However, hitting any PHP page will randomly work or fail because the open_basedir path is corrupted in some way. When this happens, a blank page is displayed in the browser. Multiple refreshes will sometimes get the page to display.

    A google search (php 5.3.0 open_basedir bug) find some PHP bugs and fixes.

    Are you able to put out an update?

    Also, is the zend stuff part of the RPMs?

    Thanks.

    • Andy says:

      Thanks for the heads up about the bug. I’ve recompiled with the patch in for i386 and x86_64 architecture, which is now in the repo.

      As for most of Zend’s stuff, they are not open-source, so I’m unable to compile them for 5.3.

    • Roger Walker says:

      I tried the new RPMs, and although the error seems to be less frequent, it still persists. Here’s what my error log shows for a squirrelmail login:

      httpd: PHP Warning: Unknown: open_basedir restriction in effect. File(/home/websites/webmail/website/src/redirect.php) is not within the allowed path(s): (��U\+) in Unknown on line 0

      I get similar issues and log entries for wordpress.

      Here’s what I just used for my google search terms which returned only a few items:

      php 5.3.0 bug “PHP Warning: Unknown: open_basedir restriction in effect”

    • Roger Walker says:

      I may have jumped the gun on my followup to your update. Seems I neglected to restart apache – I think it kept an old version of PHP in memory. After restarting the webserver, I haven’t seen any problems.

      Thanks for the quick update.

  45. Roger Walker says:

    I have also upgraded to your latest php 5.3.1 I now have a request for the GD library. I notice that you do not currently have php-gd among your RPMs. A regular yum install doesn’t work because there’s a dependency requiring an earlier version of php-common.

    Do you have plans for php-gd?

    Thanks.

    • Andy says:

      Hi Roger,

      The repo comes with php-gd in, is it possible you are not enabling the repo when you install it? Since the repo file I supply is set to enable=0, you’ll have to do:

      yum install --enablerepo=webtatic php-gd

    • Andy says:

      Ah, sorry, Wordpress stupidly converts two dashes to one long dash, I had to use html encoding to get it to show correctly.

  46. Diamond says:

    I’m trying to use this repo and getting the following error:

    yum –enablerepo=webtatic update php
    Setting up Update Process
    Setting up repositories
    http://repo.webtatic.com/yum/centos/4/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
    Trying other mirror.
    Cannot open/read repomd.xml file for repository: webtatic
    failure: repodata/repomd.xml from webtatic: [Errno 256] No more mirrors to try.
    Error: failure: repodata/repomd.xml from webtatic: [Errno 256] No more mirrors to try.

    It looks like you dont have this available for Centos4, do you plan to make it available by chance?

    • Andy says:

      Sorry, I don’t have any plans to release for CentOS 4.

      The problem is that it takes a while to build and manage the RPMs, and I am unable to give them a good testing.

  47. R Agi Sagita says:

    Hi Andy,

    Thanks for this great information. It works!

    Agi

  48. Arend says:

    A big thank you!

    It works just great

  49. Jan says:

    Hello,

    It works great but i need mcrypt can someone tell me how i will get it work?

    Greetings,

    Jan Kappert

    • Andy says:

      If you didn’t have it installed when you ran the update, you’ll have to install it whilst enabling the repo again:

      yum install –enablerepo=webtatic php-mcrypt

  50. Nizzy says:

    I got an error of php-mhash, and I already installed it and tried to re-install it..still no luck. Please help me. thank you

    [root@123 etc]# yum –disablerepo=* –enablerepo=webtatic update php
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Setting up Update Process
    Resolving Dependencies
    –> Running transaction check
    –> Processing Dependency: php = 5.2.11-2.el5.art for package: php-devel
    –> Processing Dependency: php = 5.2.11-2.el5.art for package: php-devel
    —> Package php.x86_64 0:5.3.1-1 set to be updated
    –> Processing Dependency: php-cli = 5.3.1-1 for package: php
    –> Processing Dependency: php-common = 5.3.1-1 for package: php
    –> Running transaction check
    –> Processing Dependency: php-common = 5.2.11-2.el5.art for package: php-mcrypt
    –> Processing Dependency: php-common = 5.2.11-2.el5.art for package: php-mysql
    –> Processing Dependency: php-common = 5.2.11-2.el5.art for package: php-xml
    –> Processing Dependency: php-common = 5.2.11-2.el5.art for package: php-imap
    –> Processing Dependency: php-common = 5.2.11-2.el5.art for package: php-gd
    –> Processing Dependency: php-common = 5.2.11-2.el5.art for package: php-pdo
    –> Processing Dependency: php-common = 5.2.11-2.el5.art for package: php-mbstring
    —> Package php-devel.x86_64 0:5.3.1-1 set to be updated
    –> Processing Dependency: php = 5.2.11-2.el5.art for package: php-devel
    –> Processing Dependency: php-mhash for package: php-pear-Crypt-CBC
    —> Package php-cli.x86_64 0:5.3.1-1 set to be updated
    —> Package php-common.x86_64 0:5.3.1-1 set to be updated
    –> Running transaction check
    —> Package php-pdo.x86_64 0:5.3.1-1 set to be updated
    —> Package php-mysql.x86_64 0:5.3.1-1 set to be updated
    –> Processing Dependency: php = 5.2.11-2.el5.art for package: php-devel
    —> Package php-xml.x86_64 0:5.3.1-1 set to be updated
    –> Processing Dependency: php-mhash for package: php-pear-Crypt-CBC
    —> Package php-mbstring.x86_64 0:5.3.1-1 set to be updated
    —> Package php-mcrypt.x86_64 0:5.3.1-1 set to be updated
    —> Package php-imap.x86_64 0:5.3.1-1 set to be updated
    —> Package php-gd.x86_64 0:5.3.1-1 set to be updated
    –> Finished Dependency Resolution
    php-pear-Crypt-CBC-0.4-1.el5.art.noarch from installed has depsolving problems
    –> Missing Dependency: php-mhash is needed by package php-pear-Crypt-CBC-0.4-1.el5.art.noarch (installed)
    php-devel-5.2.11-2.el5.art.i386 from installed has depsolving problems
    –> Missing Dependency: php = 5.2.11-2.el5.art is needed by package php-devel-5.2.11-2.el5.art.i386 (installed)
    Error: Missing Dependency: php = 5.2.11-2.el5.art is needed by package php-devel-5.2.11-2.el5.art.i386 (installed)
    Error: Missing Dependency: php-mhash is needed by package php-pear-Crypt-CBC-0.4-1.el5.art.noarch (installed)

    [root@123 etc]# yum –disablerepo=* –enablerepo=webtatic install php-mhash
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Setting up Install Process
    Parsing package install arguments
    Package matching php-mhash-5.2.11-1.x86_64 already installed. Checking for update.
    Nothing to do

    • Andy says:

      mhash was removed from PHP in 5.3. Since there is no new RPM for it, yum is trying to match the last version which doesn’t support the php installation.

      The PHP changelog says:

      Moved extensions to PECL (Derick, Lukas, Pierre, Scott):

      * ext/dbase
      * ext/fbsql
      * ext/fdf
      * ext/ncurses
      * ext/mhash (BC layer is now entirely within ext/hash)
      * ext/ming
      * ext/msql
      * ext/sybase (not maintained anymore, sybase_ct has to be used instead)

Leave a Reply