Tom's PHP4/MySQL4 on FC4, FC5, FC6 HowTo 04.01.07 Rev 1.0 Maintained By Tom Sandquist tom@420bakers.net Getting Started First we need to make sure that we have all of the necessary tools to do this. Make sure that rpm, rpm-build and gcc are installed before continuing. I'm assuming you will be the root user for the remainder of this document. $ yum install rpm rpm-build gcc You will need additional packages at different points. Be prepared to install them as they are required. Note: The yum search command will be your best friend for this. If you don't already know the package name use this command to find it: $ yum search Installing MySQL4 (Only for FC5, FC6) First you need to remove MySQL5 from the system. Use the following command to remove MySQL from the system: $ yum remove mysql To ensure that all of the MySQL5 packages are removed check to see if any are still in the rpm database: $ rpm -qa |grep mysql If you see any packages that start with mysql make sure you remove them! MySQL5 has to be completely removed before you can install the older version. Use this command to remove any additional mysql packages on the system: $ rpm -e Now that you have removed MySQL5 it's time to get a copy of MySQL4. Use the following command to download the final updated FC4 MySQL4 package: $ wget -c http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/SRPMS/mysql-4.1.20-1.FC4.1.src.rpm Now we must rebuild the source rpm package so that it will work under FC5. Run the following command: $ rpmbuild --rebuild mysql-4.1.20-1.FC4.1.src.rpm This will take awhile (nearly an hour on some systems). When it's done you should have some rebuilt MySQL4 packages for FC5 in the /usr/src/redhat/i386/RPMS directory. Move these packages to the /root/ directory (I would actually suggest you create a subdirectory in the /root/ directory called mysql4, if you don't make sure after moving these files to the /root/ directory you delete the mysql source rpm to avoid package install issues). You will want to install the mysql, mysql-server, and mysql-devel packages that you build. Please note the --nodeps switch being used, this is because mysql will not install without the perl module perl-DBD-mysql. We have to rebuild this package as well but the correct version of MySQL has to be installed in order to do this. The --nodeps switch tells rpm to ignore any package dependancies. $ rpm --nodeps -ivh mysql-4* mysql-server* mysql-devel* Now we need to grab a copy of the perl-DBD-mysql source package and rebuild it. $ wget -c http://download.fedora.redhat.com/pub/fedora/linux/core/4/SRPMS/perl-DBD-MySQL-2.9007-1.src.rpm $ rpmbuild --rebuild perl-DBD-MySQL-2.9007-1.i386.rpm This shouldn't take too long (maybe 15 minutes or so). Once it's done move the package from /usr/src/redhat/i386/RPMS to the /root/ directory (or the /root/mysql4 directory if you created it) and install it (making sure that you deleted the source package if you are installing from /root/). $ rpm -ivh perl-DBD-MySQL* That should be it. If you come across something that needs to be changed or doesn't work in this procedure please either modify it or let me know so I can correct this doc. There is nearly no documentation on how to do this online so a lot of this was me figuring it out. ------------------------------------------------------------------------------ Downgrading PHP5 to PHP4 on FC4/5 This section of the HowTo is based off of the information at the following site: http://www.mjmwired.net/resources/mjm-fedora-php4.html. I have modified this proceedure slightly to account for the MySQL downgrade steps above. Things that need to be installed prior to rebuilding the source rpms. yum install apr-devel apr-util-devel libc-client postgresql beecrypt-devel elfutils-devel postgresql-devel \ httpd-devel net-snmp-devel libc-client-devel aspell-devel unixODBC-devel w3c-libwww-devel yum install bzip2-devel curl-devel gmp-devel libjpeg-devel libpng-devel pam-devel pcre-devel libxslt-devel \ libxml2-devel ncurses-devel freetype-devel Here is the link to the procedure online. When I get some time I will mirror this page locally. Until then here are a few notes to be careful of when doing this. Under the Compile section of the guide the first step asks you to use yum to install some packages. MAKE SURE TO NOT INCLUDE MYSQL-DEVEL IN THAT LIST IF YOU JUST DOWNGRADED MYSQL!!! If you do include mysql-devel in that command you will totally undo everything you just did in the MySQL Downgrade section! Also note that when I did this I had to install a few undocument packages. I have included most, if not all of those in the yum command above but depending on your install you may or may not need to install some additional packages. One last nice thing to do is to edit the /etc/yum.conf file and globally exclude php, mysql, and perl-DBD-MySQL so that the next time you run 'yum update' everything doesn't break! http://www.mjmwired.net/resources/mjm-fedora-php4.html