Upgrading to PHP 5.2.4 on RHEL and CentOS
September 5, 2007 by Jason · 70 Comments
Well, it's been 3 months since the last release of PHP 5.2 but 5.2.4 is finally here. Unlike the earlier releases of PHP 5.2 which have included both performance/memory optimizations as well as fixes for critical bugs (security issues and otherwise), this release is aimed at improving the overall stability of the 5.2 release chain (no doubt aiming to improve the image of PHP 5.2 with 4.4 being discontinued at the end of the year) by fixing more than 120 small bugs, as well as taking the opportunity to fix a few low-level security holes.
The PHP development team didn't slap a "0mg!!! j00 m|_|$7 |_|pd473 j00r php 0r 3l$3 j00 \/\/1ll b3 h4ck3d!!!" tag on this one but stability is always a good thing so I would recommend that all of my readers upgrade when they get a chance. Really though, since I do all the work, do you really have an excuse NOT to update?
Along with the upgraded PHP packages I've also generated updated versions of the PCRE packages. PHP 5.2.4 updated the bundled version to 7.2 and I was still on 7.0, so I figured, "why not stay ahead of the crowd?" and jumped all the way to 7.3.
UPDATE (9/17/2007): The src.rpm has been updated. Those of you having problems using it to build your own binaries shouldn't have issues anymore. Also, in these newer revision packages I have added "php-mssql" and "php-embedded" as both of these are in the latest builds from Fedora Devel. Finally, php-dbase has been merged into php-common, again, as with the latest packages from Fedora Devel.
PHP 5.2.4 Release Notes / Changelog
Update (9/24/2009): Packages deleted, use the yum repository instead.
@OJ,
I really don't know anything about CPanel aside from the fact that it compiles everything from source even if you're using an RPM-based distro. If you are using CPanel then you cannot use the files from my repo.
@Psykick,
DOM is a part of the 'php-xml' package. If you install it then it will work. It will never show at the top of your phpinfo() as the modules are all compiled separately to minimize the size of the core and reduce the number of features that are forced on people.
Oh, and this is not any different from 5.2.3. If you had 'php-xml' installed while you were using that version then it should have worked just fine (as the module passed the test after compile).
Hi Jason,
Thanks for everything on this site. It is very informative and helpful. I am very much a Linux novice, and I need to set up php with zip support on RHEL5. I have everything updated to your most recent versions, but I am unsure as to how I can recompile your package to include zip support. Is there something that I am missing or a different way to go about this?
Thanks!
Jeremy
@Jeremy,
The 'php-common' package provides 'php-zip'. If that isn't what you need then you may want to tell me what configure statement is needed to provide the support you require.
Not sure if my first post went through.
I installed a new CentOS 5 server and have added httpd, mysql and php from this repository. So far so good. When I went to install php-domxml though I ran into the following error:
yum --enablerepo=utter install php-domxml
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
base 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
utter 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
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package php-xml.i386 0:5.2.3-jason.2 set to be updated
--> Running transaction check
--> Processing Dependency: php-common = 5.2.3-jason.2 for package: php-xml
--> Processing Dependency: libxslt.so.1 for package: php-xml
--> Processing Dependency: libexslt.so.0 for package: php-xml
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package libxslt.i386 0:1.1.17-2 set to be updated
--> Running transaction check
--> Processing Dependency: php-common = 5.2.3-jason.2 for package: php-xml
--> Finished Dependency Resolution
Error: Missing Dependency: php-common = 5.2.3-jason.2 is needed by package php-xml
The php packages I have installed so far are:
php-common-5.2.4-jason.2
php-cli-5.2.4-jason.2
php-pdo-5.2.4-jason.2
php-5.2.4-jason.2
php-mysql-5.2.4-jason.2
php-gd-5.2.4-jason.2
Any chance we can get that php-xml updated ?
Thank you in advance
BH
@BigHusky,
I'm not sure why you're trying to install "php-domxml"; that is not a valid package in my repo. You probably want "php-xml" (of which there is a 5.2.4-jason.2 release). Let me know if you have trouble with that package.
I have similar trouble when trying to install upgrade php to 5.2.4. I have stock RHEL 5.
# yum install php
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
Setting up Install Process
Setting up repositories
rhel-i386-server-5 100% |=========================| 1.2 kB 00:00
rhel-i386-server-vt-5 100% |=========================| 1.2 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package php.i386 0:5.2.4-jason.2 set to be updated
--> Running transaction check
--> Processing Dependency: php-common = 5.2.4-jason.2 for package: php
--> Processing Dependency: php Processing Dependency: php-cli = 5.2.4-jason.2 for package: php
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package php-cli.i386 0:5.2.4-jason.2 set to be updated
---> Package php-common.i386 0:5.2.4-jason.2 set to be updated
--> Running transaction check
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php-xml
--> Processing Dependency: php Processing Dependency: php-common = 5.1.6-15.el5 for package: php-gd
--> Processing Dependency: php-common = 5.1.6-15.el5 for package: php-mbstring
--> 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: php-common = 5.1.6-15.el5 for package: php-imap
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package php-mysql.i386 0:5.2.4-jason.2 set to be updated
---> Package php-xml.i386 0:5.2.4-jason.2 set to be updated
---> Package php-pdo.i386 0:5.2.4-jason.2 set to be updated
---> Package php-gd.i386 0:5.2.4-jason.2 set to be updated
---> Package php-mbstring.i386 0:5.2.4-jason.2 set to be updated
---> Package php-imap.i386 0:5.2.4-jason.2 set to be updated
--> Running transaction check
--> Processing Dependency: php Finished Dependency Resolution
Error: Missing Dependency: php <= 5.2.0 is needed by package php-sqlite2
Any idea how to fix that?
@Peter,
To my knowledge, there is no package that ships with EL5 called "php-sqlite2". If you are using RPMs from some other 3rd party repository then you may run into issues. If not, I don't have any idea where that dep is coming from.
In any case, sqlite functionality is rolled into "php-pdo", so you should be OK in removing that "php-sqlite2" package and then installing "php-pdo".
Thanks Jason,
I will give it a try
Thank you for this .. It was all a success for me.
.. I was a bit to fast on saying that.
When I run
$ rpmbuild --rebuild php-5.2.4-jason.2.src.rpm
It all goes well untill it reaches the testing. Then it hanges on
[..]
PASS zlib.inflate (with convert.base64-decode) [ext/zlib/tests/zlib_filter_inflate.phpt]
TEST 2543/2569 [sapi/cgi/tests/001.phpt]
Could anyone tell me why, and how can I get passed this point?
I did it .. I uninstalled the previous version (which was 5.1.4) and then it worked fine.
Thanx .. now onto httpd 2.2.6 😀
ARHHHGG ...
How the f**** do I get oci8-instant-client to work as well.
damn me! :S
When I add --with-oci8=instantclient,$ORACLE_HOME/lib I get an error saying
checking Oracle Instant Client directory... /usr/lib/oracle/10.2.0.2/client/lib
checking Oracle Instant Client SDK header directory... /usr/include/oracle/10.2.0.2/client
checking Oracle Instant Client version... 10.1
checking for unixODBC support... yes, shared
checking whether to enable pcntl support... yes
checking for fork... no
configure: error: pcntl: fork() not supported by this platform
error: Bad exit status from /var/tmp/rpm-tmp.58259 (%build)
Can anyone tell what I am doing wrong ?
@Harabanar,
Some people have had issues with the tests when they've already got PHP installed. As you already found out, removing your currently-installed version gets around that problem. Of course, you could also just use the prebuilt binaries I've provided in my yum repo and then you don't have to rebuild anything.
As to your fork() issue, I'd suggest looking at the config.log output to find out what really caused that failure. My guess is that you're missing a "-devel" package.
Ok .. what am I actually looking for 😀
I cant not remove php-sqlite2 due to some error:
# rpm -e php-sqlite2-5.1.6-200705230945
error: Failed dependencies:
any-php-sqlite2 is needed by (installed) sb-publish-3.0.1-200705230947.noarch
Seems like plesk need it.
So what do i need to do to solve this?
Thanks
@Harabanar,
Open the config.log file and start searching, from the bottom towards the top, for lines that contain "error".
@Peter,
Well, again, I don't know where that 'php-sqlite2' package came from. SQLite connectivity is built into 'php-pdo' but it is not identical to the SQLite connectivity from PHP 4 (which I believe was called 'sqlite2').
'sb-publish' is part of Plesk's "Site Builder". If you don't use it then you're probably safe in removing both. If you do, you could take a chance that it also works with the connectivity exposed by 'php-pdo'. If it's something you can't live without then I'd suggest not moving forward with the update.
I'm looking through srpm - can't see oci added. And i missing smth ?
I used your packages to add mysql and php (5.2.2) to my RHEL4 machine. I went to actually use PHP with mysql today and of course the php-mysql extension is not there (and it no longer is compiled into php). Can you tell me how to get the php-mysql RPMs for php 5.2.2 or the 5.2.4 that I could upgrade to? Any help out of RPM hell is appreciated.
Mike
@Mike,
You haven't mentioned how you've installed PHP on your system. If you're using my yum repository then the newest version available is 5.2.5 and the 'php-mysql' package is available. If you compiled it yourself then you should check your build output folder as there should be a file that starts with 'php-mysql'.