Upgrading PHP on Fedora Core 5 (or other distro)
Mar.03, 2008 in
Linux
Download the RPMs you require for your new PHP installation from the following URLs. If you have RPMs that aren’t listed, use the search function:
- php-5.2.5
- pcre-6.6
- php-cli-5.2.5
- php-common-5.2.5
- php-pear-1.7.1
- php-gd-5.2.5
- php-pd-5.2.5
- php-mysql-5.2.5
- sqllite
Or if you are upgrading another distrobution, search for the equivalents here.
Check which PHP RPMs you currently have installed:
rpm -qa | grep phpphp-5.1.6-1.6
Output should be something like:
php-pear-1.4.9-1.2 php-pdo-5.1.6-1.6 php-gd-5.1.6-1.6 php-mysql-5.1.6-1.6
** Do The Following Steps As ‘Root’ **
Now we need to remove the installed PHP RPMs prior to installing our new RPMs:
rpm -e php php-pear php-pdo php-gd php-mysql
Now install the PHP modules as required:
rpm -Uvh pcre-6.6-1.fc5.remi.i386.rpm rpm -ivh php-common-5.2.5-1.fc5.remi.i386.rpm rpm -ivh php-cli-5.2.5-1.fc5.remi.i386.rpm rpm -ivh php-5.2.5-1.fc5.remi.i386.rpm rpm -ivh sqlite2-2.8.17-1.fc5.i386.rpm rpm -ivh php-pdo-5.2.5-1.fc5.remi.i386.rpm rpm -ivh php-mysql-5.2.5-1.fc5.remi.i386.rpm rpm -ivh php-pear-1.7.1-1.fc5.remi.noarch.rpm
Now restart apache:
apachectl graceful
And we should have php version 5.2.5 installed!

July 25th, 2008 at 12:31 am
I am just searching the solution for upgrading php to 5.2.x.
It is very lucky that I see this solution here.
However, because there are plenty of job working in my fedora core 5, I have to make sure there is no problem after upgrading it.
From my search on the web, you are not able to install the PHP5.2 directly by downloading the file from the PHP.net. It is because there will be too many discripency issue.
Also, I have read some article on the web that, when you upgrade the PHP5.2 in FC5, you also have to upgrade the apache and the mysql package.
In this post, I can only see that, PHP5.1 is removed and then PHP5.2 is installed.
I wonder, if there are any problem affect the current web application by using php5.1, mysql and apache?
Is it necessary to upgrade the mysql and apache as well?
It would be quite trouble for me if the web applications are down. i would just like to confirm if everything will be fine after upgrading.
Thanks for all your help in advance.
September 24th, 2008 at 7:17 pm
Thanks a bunch friend! This made my work really simple and easy.. I didn’t know that this could be done so easily
October 2nd, 2008 at 3:19 pm
You Da MAN!! After hours of trying to compile and make PHP 5.2 work with my Fed5 server this worked in like 10 minutes!! Thank You
November 14th, 2009 at 4:21 am
Hey your solution doesnt workedout for me. When i tried to remove the php using “rpm -e ..” command it is throwing me a error like, Dependencies are there so cannot be uninstalled. I tried to update the same via yum too. I got the same error during that time too. Is there any other way to update the php version to latest stable like 5.2.9 from my php version 5.1.6 which comes with my fc5 core installation itself. Can anyone help me out on this?