NOTE: The content of this page may be outdated. Links may not be valid and the steps detailed may no longer work. This page is saved for archival purposes only.
This mini guide is how I downgraded my PHP on Fedora Core 4, from PHP4 to PHP5. Some PHP applications are not compatible with PHP5, hence the need for this guide. The basic procedure is to remove PHP5 and install PHP4 using the latest FC3 updated RPMs
Note: Alternative guide for recompiling the SRC.RPM can be found on a newer guide: PHP4 on Fedora Core.
You must remove all PHP5 RPM's installed in FC4 either through yum or manually. Note that neither method will remember which parts of PHP you had installed.
[root@charon ~]# yum remove php
Manually make sure to get every RPM:
[root@charon ~]# rpm -qa | grep php php-pear-5.0.4-10 php-5.0.4-10 php-imap-5.0.4-10 php-mysql-5.0.4-10 php-xmlrpc-5.0.4-10 php-gd-5.0.4-10 [root@charon ~]# rpm -e php-xmlrpc php-pear php-gd php-mysql php php-imap
The FC3 Updates has 4.3.11-2.8 as of Nov 8, 2005. Download every file (PHP4) you removed from above (PHP5). Note: For users of x86_64 Fedora, please use: x86_64 FC3 Updates.
You should download them all to a single directory and group install them:
[root@charon php]# rpm -ivh php-*.rpmDependancy Problems
It is highly recommended you have all compatibility libraries installed in FC4.
The following commands were tested for Fedora 32bit. Users of x86_64 Fedora please make sure to suffix your RPM's with: x86_64. If you are unsure as to which version of the RPM you should install using yum, please run:
yum list package_name
Where the package_name is the RPM in question.
The first dependancy problem I encountered was about libcrypto.so.4 and libssl.so.4. These were resolved by installing the openssl097a RPM
(this is the FC4 version, not FC3). Either install from the Fedora site or through yum:
[root@charon php]# yum install openssl097a
x86_64 users: # yum install openssl097a.x86_64
Others have found a dependancy problem with libdb-4.2.so. These are resolved by installing the compat-db-4.2.52-2 RPM. Also available on the FC4 CD's or DVD. Additionally, should be available from the Fedora site or through yum.
Postgres dependancy issues. When installing php-pgsql, there is a complaint for libpq.so.3. FC3 shipped with Postgres 7.x while FC4 shipped with 8.x. Hence you can either revert entirely back to 7.x or you must find a compatibility library as we did above. I did find a mention of this on Bruno's blog - however I have not tried it and I do NOT know how it works.
Configuration changes should not be required. Since FC3 also shipped with Apache 2.0, the PHP4 RPM's should correctly work without manual changes to the httpd.conf.
[root@charon ~]# /etc/init.d/httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ]
If there are any errors regarding PHP they will show in this step.
Since you are manually installing the PHP RPM's and they belong to another distribution, you cannot use YUM to update them. Chances are they will be replaced with PHP5 RPM's again.
You must specify to YUM, not to update the PHP parts you are using.
EDIT: /etc/yum.conf ADD at the end of the file: exclude=php*
If this is for a production server I would recommend you are very careful in following along with updates. You can check the FC3 Updates for PHP updates and group install them. Just make sure to match the correct files:
[root@charon php]# rpm -Uvh php-*.rpm
There are multiple other ideas that you can try to set up PHP4 in FC4. These are all require extra work and probably not recommended unless you understand exactly what you are doing.
Updated Note: Recompiling the SRC.RPM can be found on a newer guide: PHP4 on Fedora Core.
Other ideas are welcome. In the end the best recommendation is to try to update all your PHP software so that it is compatible with PHP5. Also, if you have production needs look for other distributions (like CentOS) that support PHP4 or both PHP4/PHP5.
Help Out: If you found this guide or any Resource helpful, please consider supporting this site by recommending this page to others or linking to this page. I appreciate all the support I receive. Thank you in advance.
Disclaimer: The author makes no claim to the accuracy of the information provided. This information is provided in the hope that it will be useful, but WITHOUT ANY WARRANTY. There is no implied support from referencing this guide. Any help that is provided is at will. Use this information at your own risk. Always make proper backups and use caution when modifying critical system files.
PLEASE DO NOT mirror, translate or duplicate this page without contacting me.
Copyright © 2003-2013 by Mauriat Miranda (mjmwired.net).