Upgrading to PHP 5.2.5 on RHEL and CentOS
November 16, 2007 by Jason · 141 Comments
After a little more than 2 months of waiting since the last release, PHP has been updated once again, this time to 5.2.5. The 5.2.5 release brings several security enhancements, more than 60 bug fixes, and improved performance for those of you that like arrays (and really, who doesn't?).
PHP 5.2.5 also updated the bundled version of PCRE to 7.3, although if you're a user of my repository you've been using that version for quite some time now, and the timezone database to 2007.9.
Now, what you've all been waiting for... The links! As always, I would encourage everyone reading this to add my Yum repository to your system for quick, easy updates. If you really don't want to, feel free to rebuild the Source RPM at the link below.
Update (11/19/2007): Source RPM updated to fix test issue on certain systems. No binary package updates since the change doesn't actually affect anything but the test cases.
PHP 5.2.5 Release Notes / Changelog
Update (9/24/2009): Packages deleted, use the yum repository instead.
Jason, I am looking to upgrade a stock RHEL4 box with your PHP5.2.5 RPMS via YUM.
Checking what is currently installed:
# rpm -qa php*
php-mbstring-4.3.9-3.22.9
php-4.3.9-3.22.9
php-eaccelerator-4.3.9_0.9.3-4.2.el4.rf
php-snmp-4.3.9-3.22.9
php-mysql-4.3.9-3.22.9
php-ldap-4.3.9-3.22.9
php-devel-4.3.9-3.22.9
php-pear-4.3.9-3.22.9
php-gd-4.3.9-3.22.9
using YUM check-update I see everything listed with the exception of php-pear-x
Is there something I need to do to include pear in the update?
php.x86_64 5.2.5-jason.1 utterramblings
php-devel.x86_64 5.2.5-jason.1 utterramblings
php-gd.x86_64 5.2.5-jason.1 utterramblings
php-ldap.x86_64 5.2.5-jason.1 utterramblings
php-mbstring.x86_64 5.2.5-jason.1 utterramblings
php-mysql.x86_64 5.2.5-jason.1 utterramblings
php-snmp.x86_64
eaccelerator is not an issue, I just need to ensure pear in included in the yum update.
I tried up2date for the php upgrade as well. Using up2date, I can do a --dry run to see if the upgrade would work, I do not know of a way to do that using yum. This is the result from the --dry run, can you help me to solve the failed dependencies (I will uninstall eaccelerator before the update)
# up2date --dry-run php php-devel php-gd php-ldap php-mbstring php-mysql php-pear php-snmp
Fetching Obsoletes list for channel: utterramblings...
Fetching rpm headers...
########################################
Name Version Rel
----------------------------------------------------------
php 5.2.5 jason.1 x86_64
php-devel 5.2.5 jason.1 x86_64
php-gd 5.2.5 jason.1 x86_64
php-ldap 5.2.5 jason.1 x86_64
php-mbstring 5.2.5 jason.1 x86_64
php-mysql 5.2.5 jason.1 x86_64
php-pear 1.6.2 1.jason.1 noarch
php-snmp 5.2.5 jason.1 x86_64
Testing package set / solving RPM inter-dependencies...
Downloading headers to solve dependencies...
#######################################
Downloading headers to solve dependencies...
There was a package dependency problem. The message was:
Unresolvable chain of dependencies:
php-5.2.5-jason.1 requires httpd-mmn = 20051115
php-eaccelerator-4.3.9_0.9.3-4.2.el4.rf requires php = 4.3.9
php-mysql 5.2.5-jason.1 requires libmysqlclient.so.15()(64bit)
php-mysql 5.2.5-jason.1 requires libmysqlclient.so.15(libmysqlclient_15)(64bit)
The following packages were added to your selection to satisfy dependencies:
Package Required by
----------------------------------------------------------------------------
php-cli-5.2.5-jason.1.x86_64 php-5.2.5-jason.1 php-cli
php-cli-5.2.5-jason.1.x86_64 php-pear-1.6.2-1.jason.1 php-cli
php-common-5.2.5-jason.1.x86_64 php-ldap-5.2.5-jason.1 php-common
php-common-5.2.5-jason.1.x86_64 php-snmp-5.2.5-jason.1 php-common
php-common-5.2.5-jason.1.x86_64 php-mbstring-5.2.5-jason.1 php-common
php-common-5.2.5-jason.1.x86_64 php-gd-5.2.5-jason.1 php-common
php-common-5.2.5-jason.1.x86_64 php-5.2.5-jason.1 php-common
php-common-5.2.5-jason.1.x86_64 php-mysql-5.2.5-jason.1 php-common
thx again Jason!
but now I have other prob...
Seems that php mysql extension cannot be use under console????
Any ideas?
thx in advace
Hi,
I'm running a CentOS 5 server with Zervex's ServerCP control panel. I'm wondering if I can use this repository to update PHP to 5.2.5 since I am using yum update? Do I need a special repository that is set up by the Zervex crew, or can any repository be used since it is CentOS and it would be done with yum?
Thanks,
railer
(Sorry if this is a dumb question, I'm new to server administration...)
@Jeff,
Pear is included. It's the 'php-pear' package.
As to your dry-run issues, you cannot upgrade PHP using my repo without also updating MySQL to 5.0.x and httpd to 2.2.x. Do your dry run without specifying the package names. if you only want to upgrade PHP then you'll need to download my source rpm and rebuild it for your version of httpd and mysql.
Oh, and I supply 'php-xcache' instead of 'php-eaccelerator'. I like XCache better.
@ross,
Works for me. Is there a "mysql" section in the output of "php -i"?
@railer,
I've never heard of "Zervex". I would have to say that if that package uses the distro's default httpd, MySQL, and PHP RPMs then you'll probably be OK. If it uses custom RPMs then it MIGHT work. If it compiles those apps from source (as CPanel does) then it's not going to work for you.
Thanks Jason, I added all httpd php and mysql packages to the --dry run, the same 2 unresolvable dependencies remain
php-mysql 5.2.5-jason.1 requires libmysqlclient.so.15()(64bit)
php-mysql 5.2.5-jason.1 requires libmysqlclient.so.15(libmysqlclient_15)(64bit)
Any idea how I can update/correct for the libmysqlclient.so.15 dependency?
It looks like my system has libmysqlclient.so.14 installed, I ran:
# rpm -q --whatprovides /usr/lib64/mysql/libmysqlclient.so.14
mysql-4.1.20-2.RHEL4.1.0.1
so it looks like libmysqlclient.so.15 needs to be built into your mysql-5.0.54-jason.1.x86_64.rpm
this way php-mysql-5.2.5-jason.1.x86_64.rpm can access and use it.
I installed MySQL-shared-compat-5.0.45-0.rhel4.x86_64.rpm right from the mysql website, and it took care of the unresolvable dependencies error 😉
regarding xcache... does your RPM install a web GUI page, and if so, where/how can it be accessed.
@Jeff,
This is from a 32-bit box but the 64-bit packages use the same spec file so they should be the same (aside from the path).
[[email protected] /]# rpm -q --whatprovides /usr/lib/mysql/libmysqlclient.so.14
mysqlclient14-4.1.14-4.2.1.jason.1
[[email protected] /]# rpm -q --whatprovides /usr/lib/mysql/libmysqlclient.so.15
mysql-5.0.54-jason.1
What was the actual command you were running? Why didn't you just do a dry run of the entire "yum update"?
I prefer to use up2date over yum... just because.
I ran up2date -l to locate the php/httpd/mysql packages, then ran this command:
up2date --dry run httpd httpd-devel httpd-manual php php-devel php-gd php-ldap php-mbstring php-mysql php-pear php-snmp mysql mysql-devel mysql-server mysqlclient10
That line included all php/httpd/mysql packages from your repository flagged for my arch.
I removed the RHEL repository from the config to grab only your files.
@Jeff,
Hmmm... The only thing I can think of off-hand is that since you're not using a broad update and instead are specifying packages by name, you might not be getting some of the deps
(apr, pcre, etc.).
ahh, yes, I left those out of my list, as I was unsure what they did, and if they were required.
My stock RHEL4 php build is not configured with mysqli enabled. Does your build configure and enable mysqli?
Thanks very much for your help Jason and for the excellent packages.
All working with Mysql PDO driver loaded 🙂
@Jeff,
Yes, mysqli is included in the 'php-mysql' package.
@Dave,
Good to hear.
After adding your repository, I typed yum update php but didn't realize this would change my apache configuration. Can you let me know how to install the mod_access (or any other) module back into the apache web server?
Oops nevermind, I'm now learning about mod_authz_host.so in httpd 2.2
Hi,
I currently have PHP 5.1.6 installed on my machine (CentOS 5):
php-gd-5.1.6-15.el5
php-ldap-5.1.6-15.el5
php-5.1.6-15.el5
php-imap-5.1.6-15.el5
php-mysql-5.1.6-15.el5
php-cli-5.1.6-15.el5
php-odbc-5.1.6-15.el5
php-xml-5.1.6-15.el5
php-mcrypt-5.1.6-12.el5.centos
php-devel-5.1.6-15.el5
php-common-5.1.6-15.el5
php-pdo-5.1.6-15.el5
php-pear-1.4.9-4
php-mbstring-5.1.6-15.el5
php-xcache-5.1.6_1.2.2-jason.3
php-xmlrpc-5.1.6-15.el5
Can I just update PHP by doing rpm -Uvh php-5.2.5-jason.2.src.rpm ? Sorry I'm new to this and I don't want to break my PHP install.
@george,
Packages ending in "src.rpm" need to be compiled before they can be used. You can either do that or configure your server to use my yum repository. If you do the latter then you should know that it will also update httpd, mysql, and a couple dependencies.
Jason,
Thanks 🙂 I compiled the source RPMs and updated my PHP successfully.
Many thanks...
I have been compiling the source with that damn ./configure since 2 days.
Now it just works
Thanks for compiling the php 5.2.5 binaries. Is it compiled with the --enable-zip configure option?
@Vinny,
Yes, zip support is included, however it will not show "--enable-zip" as a part of the configure string on a phpinfo() due to the way that the modules are built.
hi jason,
i'm getting a bunch of "transaction check" errors when i try to "yum update". has about 20 lines that say "XYZ from install of ABC-jason.2 conflicts with file from package DEF". any ideas? 🙁
@roger,
Specifically, which packages (just list a couple of the conflicts)? Do you have any yum plugins installed (such as 'protectbase')?
Hi Jason,
It's me again, Tony from another thread on PHP 5.2.2.
I've followed the instructions your your Yum repository. I downloaed the PHP 5.2.5 RPM package from this post. However, when I type in #yum upgrade php-5.2.5-jason.2.src.rpm, it first processes dependency. The result shows an error saying:
Error: Missing Dependency: freetds-devel is needed by package php
I then tried yum install freetds-devel, it showed 'parsing,.....nothing to do'. I am wondering how to fix this dependency problem.
I am now using CentOS 5 with PHP 5.1.6, MySQL5 and Apache.
You help is greatly appreciated 😉
Hi Jason, I want to thank you for your repository although I had a couple questions.
I am trying to install PHP 5.2.5 .. the basis for this install is cURL .. I dont know why but apparently youre still using the outdated one that comes with centos4 7.12.xx which is a few years old and has some major security problems. I am trying to update to 7.18 and have gotten it successfully installed.. now when it comes to building PHP from the source I have been denied repeatedly..(at least 10 builds now) which the build just fails due to libtool not locating the libxml2.so file.
I was wondering if you could possibly write a php.spec file that builds ONLY the root .. no cli, common, etc.. without having to use libtool. I have tried removing as much as possible from the spec to no avail and I am sure Its because im missing something.
Any help would be appreciated.. thanks!
Jaz
Hi Jason,
It looks like the CLI version of php is compiled --with-json support, yet the Apache module libphp5.so is compiled with --disable-json. I have a script that needs to call json_encode(), so I'm guessing I'll have to compile it myself to enable support. Does that sound correct to you?
- Brian
@tony,
You are trying to install a Source RPM and you shouldn't be. If you've configured your box to use my yum repo then just run "yum update php".
@Jaz,
I don't update any packages on my development boxes aside from those absolute necessary to build the newest versions of httpd, php, and mysql. Updating curl is not one of those so the default version is kept (EL4 is 7.12.x and EL5 is 7.15.x).
@Brian,
The httpd module is compiled barebones and most functionality is added through other packages. json functionality is included in 'php-common'.
Hi Jason,
I used your srpm to build and install php5.2.5 on my cenoos5 box. That worked fine, not i have to apply a certain patch on php and rebuild it. I successfully changed rpm spec file, but i have one question. Could you tell me why it contains patches for older versions of php?
Patch1: php-5.2.4-gnusrc.patch
Patch2: php-4.3.3-install.patch
Patch3: php-5.2.4-norpath.patch
Patch5: php-5.0.2-phpize64.patch
Patch8: php-5.2.0-includedir.patch
Patch9: php-5.2.4-embed.patch
# Fixes for extension modules
Patch21: php-5.2.4-odbc.patch
Patch22: php-4.3.11-shutdown.patch
#Patch23: php-5.2.2-pdosym.patch
Patch24: php-5.2.3-macropen.patch
Patch25: php-4.3.9-metaphone.patch
# Functional changes
Patch30: php-5.0.4-dlopen.patch
Patch31: php-5.2.4-easter.patch
I suppose that source for 5.2.5 should already include all fixed bugs?
Regards,
Dmitry
Hi,
I got the same conflicts error as Roger did, for example
Transaction Check Error:
file /usr/bin/mysqldumpslow from install of mysql-server-5.0.58-jason.1 conflicts with file from package mysql-5.0.22-2.2.el5_1.1
.....
I am using centos 5.1.
you mentioned to install yum plugins (e.g. protectbase?). I wonder how to install those yum plugins?
thanks!!
however, when I run 'yum update php', the upgrade went smoothly. I am afraid that conflicts error is about mysql only. how do I get around those errors? thanks!
I ge the following error while trying to update php to 5.2.5:
Error: Missing Dependency: libapr-0.so.0 is needed by package subversion
Error: Missing Dependency: libaprutil-0.so.0 is needed by package subversion
Is there anything I can do?
@Dmitry,
Those patches are not necessarily bug fixes. For example, Patch31 removed 7K (or so) of code that changes the logo on your phpinfo() on Easter day. Most are just behavioral changes that Red Hat/Fedora decided they wanted in their packages. I keep them so that my packages are as close to the originals as possible, just newer versions.
@tony,
Unless I typoed, I had mentioned that you should NOT use protectbase as it will prevent external repos from replacing packages that are a part of the 'base' repo.
@George,
It sounds like you are just trying to install php, rather than all of the deps. The easiest way to update your system is going to be to use my yum repo and run a "yum update".
Got a problem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#> yum.repos.d]# yum update php
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for php to pack into transaction set.
php-5.2.5-jason.1.x86_64. 100% |=========================| 4.0 MB 00:03
http://www.jasonlitka.com/media/EL4/x86_64/php-5.2.5-jason.1.x86_64.rpm: [Errno -1] Header is not complete.
Trying other mirror.
Error: failure: php-5.2.5-jason.1.x86_64.rpm from utterramblings: [Errno 256] No more mirrors to try.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
version of yum using:
Name : yum
Arch : noarch
Version: 2.4.3
Release: 4.el4.centos
Size : 1.3 M
Repo : installed
I checked for proxy settings and I have correctly configured my proxy settings since I was able to install many other packages in the last day or so.
Right now I have some packages installed from centosplus I don't know if that makes a difference.
Thanks for the effort in general though.
Hi Jason
Good packages - however I'm trying to build my own PHP as I need T1 support, however trying to install the httpd-devel with yum from your repro. says it needs httpd jason.3 which it can't find. Any ideas why not as I can see it in your repository as an .rpm and it is in your .xml.gz files?
--> Running transaction check
--> Processing Dependency: cyrus-sasl-devel >= 2.1 for package: openldap-devel
--> Processing Dependency: httpd = 2.2.8-jason.3 for package: httpd-devel
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for cyrus-sasl-devel to pack into transaction set.
cyrus-sasl-devel-2.1.22-4 100% |=========================| 24 kB 00:00
---> Package cyrus-sasl-devel.i386 0:2.1.22-4 set to be updated
--> Running transaction check
--> Processing Dependency: httpd = 2.2.8-jason.3 for package: httpd-devel
--> Finished Dependency Resolution
Error: Missing Dependency: httpd = 2.2.8-jason.3 is needed by package httpd-devel
Alex
Hi, unfortunatley i also didn't succed in upgrading php and stuff on one of my CENTOS5 boxes.
here a snippet of what yum is telling me:
-bash-3.1# yum clean all && yum update
Loading "installonlyn" plugin
Cleaning up Everything
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
utterramblings 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 52 kB 00:00
################################################## 197/197
primary.xml.gz 100% |=========================| 834 kB 00:00
################################################## 2400/2400
primary.xml.gz 100% |=========================| 229 kB 00:00
################################################## 462/462
primary.xml.gz 100% |=========================| 157 B 00:00
primary.xml.gz 100% |=========================| 104 kB 00:00
################################################## 361/361
No Packages marked for Update/Obsoletion
then:
-bash-3.1# php -v
PHP 5.1.6 (cli) (built: Sep 20 2007 10:16:10)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
and after all that:
-bash-3.1# yum install php-mcrypt
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for php-mcrypt to pack into transaction set.
php-mcrypt-5.2.5-jason.1. 100% |=========================| 13 kB 00:00
---> Package php-mcrypt.x86_64 0:5.2.5-jason.1 set to be updated
---> Downloading header for php-mcrypt to pack into transaction set.
php-mcrypt-5.1.6-15.el5.c 100% |=========================| 4.2 kB 00:00
---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated
--> Running transaction check
--> Processing Dependency: libc.so.6(GLIBC_2.2.5)(64bit) for package: php-mcrypt
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt
--> Processing Dependency: libc.so.6()(64bit) for package: php-mcrypt
--> Processing Dependency: php-common = 5.2.5-jason.1 for package: php-mcrypt
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for php-common to pack into transaction set.
php-common-5.2.5-jason.1. 100% |=========================| 18 kB 00:00
---> Package php-common.x86_64 0:5.2.5-jason.1 set to be updated
---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated
--> Running transaction check
--> Processing Dependency: libc.so.6(GLIBC_2.2.5)(64bit) for package: php-mcrypt
--> Processing Dependency: libc.so.6(GLIBC_2.3)(64bit) for package: php-common
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php-gd
--> Processing Dependency: libc.so.6(GLIBC_2.2.5)(64bit) for package: php-common
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php-mbstring
--> Processing Dependency: libc.so.6()(64bit) for package: php-common
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php-pdo
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php-mysql
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt
--> Processing Dependency: libc.so.6()(64bit) for package: php-mcrypt
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php
--> Processing Dependency: libz.so.1()(64bit) for package: php-common
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php-cli
--> Finished Dependency Resolution
Error: Missing Dependency: libc.so.6(GLIBC_2.2.5)(64bit) is needed by package php-mcrypt
Error: Missing Dependency: libmcrypt.so.4()(64bit) is needed by package php-mcrypt
Error: Missing Dependency: libc.so.6()(64bit) is needed by package php-mcrypt
Error: Missing Dependency: libc.so.6(GLIBC_2.3)(64bit) is needed by package php-common
Error: Missing Dependency: php-common = 5.1.6-15.el5 is needed by package php-gd
Error: Missing Dependency: libc.so.6(GLIBC_2.2.5)(64bit) is needed by package php-common
Error: Missing Dependency: php-common = 5.1.6-15.el5 is needed by package php-mbstring
Error: Missing Dependency: libc.so.6()(64bit) is needed by package php-common
Error: Missing Dependency: php-common = 5.1.6-15.el5 is needed by package php-pdo
Error: Missing Dependency: php-common = 5.1.6-15.el5 is needed by package php-mysql
Error: Missing Dependency: php-common = 5.1.6-15.el5 is needed by package php
Error: Missing Dependency: libz.so.1()(64bit) is needed by package php-common
Error: Missing Dependency: php-common = 5.1.6-15.el5 is needed by package php-cli
i really dunno, what to do next 😉 on one of my centos boxes (different install) everything went right.
Any hints are appreciated 😉
ok, got it 😉 i really had to hardcode the .repo file with i386
Bah! I spent another 4/5 hours rebuilding my own httpd tree from source and scratch and built my own in the end 🙂 Good to know it's fixed though as I can update my tree at some point.
BTW I now have a nice PHP build with GD and T1Lib support built in if anyone is after a copy!
Alex
Well it installs fine, php 5.2.5, and php -v shows 5.2.5, but if I run phpinfo via apache it says php 5.2.3 (the previous install). I show that libphp5.so is still from Aug 2007, why didn't it update? Do I uninstall the php modules and reinstall? Do I need to uninstall 5.2.5, 5.2.3, then install 5.2.5?
Hi Brian
Dumb thing to check, but have you restarted your httpd to reflect the changes? Also, as PHP by default uses PHP as a module, have you updated the modules/libphp5.so - I think it only uses the PHP binary if you are running it as a CGI/Executable
Alex
Jason,
Awhile back, I upgraded to PHP 5.2.5 with yum via your repository. Everything worked great.
I am on CentOS 5, and I recently upgraded PCRE 6.6 to 7.6 and enabled Unicode support. In the PHP configure command there is this flag: --with-pcre-regex=/usr. PHP is still recognizing my old PCRE 6.6 library. After looking around, I've found I need to recompile PHP for it to use the upgraded library. Is this possible with yum? Any suggestions would be helpful.
Thanks,
Simeon
I decided to give removing php a try. Here are the steps I took:
stop mysql
stop apache
yum remove php
yum install php
start mysql
start apache
PCRE Library was still 6.6. --with-pcre-regex=/usr and PCRE's include and library files are located in /user. Any thoughts? Thanks in advance.
Just letting you know php 5.2.6 was released
@Simeon,
Upgrading to php 5.2.6 might fix your issue considering one of the security fixes is "Upgraded PCRE to version 7.6 (Nuno)"
Jesse
but when ? 🙂 Jaaaaaaaaaaaaaaason 😉 Do something.. pleaz!
hi,
I have a installation of php 5.2.2. From the cli the xsl module is not available. Although libxslt is installed and xsltproc works just fine. How can I enable/upgrade php to have this xsl module? I'm very new to php and any help would be useful.
@Jesse ... my issue was with PCRE. Version 6.6 was installed in /lib and /usr/lib. I removed the version from /lib, and the upgrade to PCRE 7.6 was completely successful. Next, I followed these steps, and PHP recognized PCRE 7.6.
stop mysql
stop apache
yum remove php
yum install php
start mysql
start apache
@All,
PHP 5.2.6 and PCRE 7.6 are now available in my repo.
Hello Jason,
Do you have an ETA on a src 5.2.6 from you?