CINXE.COM

PHP4 on Fedora

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="description" content="Installing PHP4 on Fedora"> <meta name="keywords" content="php,php4,php5,fc6,fc5,fc4,src,recompile,downgrade,apache,http,linux,fedora,httpd"> <meta name="copyright" content="Copyright (c) 2008 Mauriat Miranda"> <meta name="author" content="Mauriat Miranda"> <title>PHP4 on Fedora</title> <style type="text/css">@import "resource.css";</style> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-310280-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-310280-1'); </script> </head> <body> <h1>PHP4 on Fedora</h1> <h4>Mauriat Miranda (<a href="https://www.mjmwired.net/contact/">https://www.mjmwired.net/contact/</a>)</h4> <h4>Other <a href="https://www.mjmwired.net/resources/">Guides/Resources</a></h4> <h4>Published: 7 April 2006 (<i>updated: 23 June 2008</i>)</h4> <div class="archive"> <p><b>NOTE:</b> 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.</p> </div> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- resource_banner_top --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5258443501063629" data-ad-slot="5426699573" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <h3>Installing PHP4 on Fedora</h3> <p>This guide shows how to install PHP4 on Fedora Core 6 (FC6) using a repackaged source RPM. Some PHP applications are not compatible with PHP5, hence the need for this guide.</p> <p><b>Installing PHP4 on Fedora Core 5</b>: These same steps will work on Fedora Core 5 (FC5).</p> <p><b>Installing PHP4 on Fedora Core 4</b>: These same steps will work on Fedora Core 4 (FC4) with some very minor differences.</p> <p><b>NOTE:</b> These builds have not been tested on PPC architecture. These RPMS apply to i386 and x86_64 architecture.</p> <p><b>NOTE:</b> These instructions were meant for Fedora Core 6 (FC6) and older. There are listed below <tt>SRC.RPM</tt> for Fedora 7, Fedora 8 and Fedora 9. Please take note of minor differences between versions.</p> <span style="color:#f00;font-weight:bold;"><u>NOTE:</u> These files are provided for testing purposes only. They are NOT validated for security and hence should NOT be used on a production server.</span> <hr> <h3>Removing PHP5</h3> <p>All previously installed <b>PHP5 RPM's must FIRST be removed</b> either through <tt>yum</tt> or manually. <b>Note</b> that neither method will remember which parts of PHP were previously installed.</p> <p>Through <tt>yum</tt> (preferred method):</p> <pre>[root@charon ~]# yum remove php php-common</pre> <p><b>Note</b>: FC5 and FC4 users will not have the <tt>php-common</tt> package.</p> <p>Manually make sure to get <b>every</b> RPM:</p> <pre>[root@charon ~]# rpm -qa | grep php</pre> <p>If there are any components remaining remove them manually using: <tt>rpm -e</tt>.</p> <hr> <h3>Modified SRC Package</h3> <p>The <tt>php4.src.rpm</tt> that is provided here is the same source as is provided in Fedora Core 3 Legacy (<a href="http://download.fedoralegacy.org/fedora/3/updates/SRPMS/" target="_blank">http://download.fedoralegacy.org/fedora/3/updates/SRPMS/</a>). However there are some minor modifications made in order for it to compile in GCC4.x (used by FC4, FC5 and FC6). The only differences are listed below:</p> <ul> <li>Patch to compile: <tt>php-4.3.6-xelement.patch</tt></li> <li>PHPT test removed for FC4: <tt>ext/dba/tests/dba_db4.phpt</tt></li> <li>PHPT test removed for FC5: <tt>ext/pspell/tests/01pspell_basic.phpt</tt></li> </ul> <p>Presently this should be compatible in features and functionalities across most Fedora releases.</p> <pre>[Right-Click] and Save Based on: version 4.3.11-2.8.4.legacy <a href="http://www-personal.engin.umich.edu/~mirandam/resources/php-4.3.11-2.8.4.mjm.src.rpm">php-4.3.11-2.8.4.mjm.src.rpm</a> 25-Oct-2006 21:52 4.9MB Based on: version 4.3.11-2.8 <a href="http://www-personal.engin.umich.edu/~mirandam/resources/php-4.3.11-2.8.1.mjm.src.rpm">php-4.3.11-2.8.1.mjm.src.rpm</a> 13-Mar-2006 19:40 4.9MB</pre> <p><b>Do not link to these files, they are not in their permanent location!</b></p> <p><b>Updates:</b><br> <em>Fedora 7</em> - <tt><a href="http://www-personal.umich.edu/~mirandam/resources/php-4.3.11-2.8.5.mjm.fc7.src.rpm">php-4.3.11-2.8.5.mjm.fc7.src.rpm</a></tt><br> <em>Fedora 8</em> - <tt><a href="http://www-personal.umich.edu/~mirandam/resources/php-4.3.11-2.8.6.mjm.fc8.src.rpm">php-4.3.11-2.8.6.mjm.fc8.src.rpm</a></tt><br> <em>Fedora 9</em> - <tt><a href="http://www-personal.umich.edu/~mirandam/resources/php-4.3.11-2.8.6.mjm.fc9.src.rpm">php-4.3.11-2.8.6.mjm.fc9.src.rpm</a></tt></p> <hr> <h3>Compile</h3> <p>To compile the <tt>SRC.RPM</tt> have all the dependancies regardless if they will be used or not. If any dependancies are missed it will complain in the next step.</p> <pre>[root@charon ~]# yum install apr-devel apr-util-devel libc-client \ postgresql beecrypt-devel elfutils-devel mysql-devel postgresql-devel \ httpd-devel net-snmp-devel libc-client-devel aspell-devel unixODBC-devel \ w3c-libwww-devel</pre> <p>Compile the RPM. (PHP5 <i>must be removed before this step</i>):</p> <pre>[root@charon ~]# rpmbuild --rebuild php-4.3.11-2.8.4.mjm.src.rpm</pre> <p><b>NOTE:</b> If most likely will have errors similar to the following:</p> <pre>001+ PHP Warning: mime_magic: type regex BEGIN[[:space:]]*[{] application/x-awk invalid in Unknown on line 0</pre> <p>This will happen for users with the <tt>file</tt> RPM newer than version 4.16. (Thanks to <a href="https://www.mjmwired.net/linux/2006/04/07/php4-on-fedora-core-5/#comment-461">Alex Dupay</a>).</p> <pre>[mirandam@charon ~]$ rpm -q file file-4.17-8</pre> <p>To fix this, open <tt>/usr/share/file/magic.mime</tt> in a text editor (gedit, kate, nano, etc) and comment out line 273:</p> <pre><b>/usr/share/file/magic.mime</b> Line 273: From: 0 regex BEGIN[[:space:]]*[{] application/x-awk To: #0 regex BEGIN[[:space:]]*[{] application/x-awk</pre> <p>Recompile the SRC.RPM. All the RPM's will be located in: <tt>/usr/src/redhat/RPMS/</tt></p> <hr> <h3>Pre-Compiled Binaries</h3> <p><b><u>NOTE:</u></b> Precompiled binaries WILL NOT be gauranteed to be up to date (below). The RPM's for FC5 are already out of date.</p> <p>The following precompiled binaries RPM's for Fedora Core currently providing . <b>Do not link to these files, they are not in their permanent location!</b></p> <p>Fedora Core 6 - <b>FC6</b> - <b>i386</b>, compiled with <b>GCC 4.1</b></p> <pre> <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-4.3.11-2.8.4.mjm.i386.rpm">php-4.3.11-2.8.4.mjm..&gt;</A> 25-Oct-2006 22:02 1.4M <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-debuginfo-4.3.11-2.8.4.mjm.i386.rpm">php-debuginfo-4.3.11..&gt;</A> 25-Oct-2006 22:04 5.1M <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-devel-4.3.11-2.8.4.mjm.i386.rpm">php-devel-4.3.11-2.8..&gt;</A> 25-Oct-2006 22:04 404k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-domxml-4.3.11-2.8.4.mjm.i386.rpm">php-domxml-4.3.11-2...&gt;</A> 25-Oct-2006 22:04 52k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-gd-4.3.11-2.8.4.mjm.i386.rpm">php-gd-4.3.11-2.8.4...&gt;</A> 25-Oct-2006 22:04 105k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-imap-4.3.11-2.8.4.mjm.i386.rpm">php-imap-4.3.11-2.8...&gt;</A> 25-Oct-2006 22:04 51k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-ldap-4.3.11-2.8.4.mjm.i386.rpm">php-ldap-4.3.11-2.8...&gt;</A> 25-Oct-2006 22:04 34k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-mbstring-4.3.11-2.8.4.mjm.i386.rpm">php-mbstring-4.3.11-..&gt;</A> 25-Oct-2006 22:05 908k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-mysql-4.3.11-2.8.4.mjm.i386.rpm">php-mysql-4.3.11-2.8..&gt;</A> 25-Oct-2006 22:05 36k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-ncurses-4.3.11-2.8.4.mjm.i386.rpm">php-ncurses-4.3.11-2..&gt;</A> 25-Oct-2006 22:05 40k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-odbc-4.3.11-2.8.4.mjm.i386.rpm">php-odbc-4.3.11-2.8...&gt;</A> 25-Oct-2006 22:05 42k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-pear-4.3.11-2.8.4.mjm.i386.rpm">php-pear-4.3.11-2.8...&gt;</A> 25-Oct-2006 22:05 349k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-pgsql-4.3.11-2.8.4.mjm.i386.rpm">php-pgsql-4.3.11-2.8..&gt;</A> 25-Oct-2006 22:05 51k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-snmp-4.3.11-2.8.4.mjm.i386.rpm">php-snmp-4.3.11-2.8...&gt;</A> 25-Oct-2006 22:05 27k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc6_i386/php-xmlrpc-4.3.11-2.8.4.mjm.i386.rpm">php-xmlrpc-4.3.11-2...&gt;</A> 25-Oct-2006 22:05 55k </pre> <p>Fedora Core 5 - <b>FC5</b> - <b>i386</b>, compiled with <b>GCC 4.1</b></p> <pre> <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-4.3.11-2.8.1.mjm.i386.rpm">php-4.3.11-2.8.1.mjm..&gt;</A> 03-Apr-2006 22:05 1.4M <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-debuginfo-4.3.11-2.8.1.mjm.i386.rpm">php-debuginfo-4.3.11..&gt;</A> 03-Apr-2006 22:05 5.1M <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-devel-4.3.11-2.8.1.mjm.i386.rpm">php-devel-4.3.11-2.8..&gt;</A> 03-Apr-2006 22:05 403k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-domxml-4.3.11-2.8.1.mjm.i386.rpm">php-domxml-4.3.11-2...&gt;</A> 03-Apr-2006 22:05 51k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-gd-4.3.11-2.8.1.mjm.i386.rpm">php-gd-4.3.11-2.8.1...&gt;</A> 03-Apr-2006 22:05 103k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-imap-4.3.11-2.8.1.mjm.i386.rpm">php-imap-4.3.11-2.8...&gt;</A> 03-Apr-2006 22:05 50k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-ldap-4.3.11-2.8.1.mjm.i386.rpm">php-ldap-4.3.11-2.8...&gt;</A> 03-Apr-2006 22:05 33k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-mbstring-4.3.11-2.8.1.mjm.i386.rpm">php-mbstring-4.3.11-..&gt;</A> 03-Apr-2006 22:05 907k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-mysql-4.3.11-2.8.1.mjm.i386.rpm">php-mysql-4.3.11-2.8..&gt;</A> 03-Apr-2006 22:05 35k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-ncurses-4.3.11-2.8.1.mjm.i386.rpm">php-ncurses-4.3.11-2..&gt;</A> 03-Apr-2006 22:05 40k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-odbc-4.3.11-2.8.1.mjm.i386.rpm">php-odbc-4.3.11-2.8...&gt;</A> 03-Apr-2006 22:05 41k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-pear-4.3.11-2.8.1.mjm.i386.rpm">php-pear-4.3.11-2.8...&gt;</A> 03-Apr-2006 22:05 349k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-pgsql-4.3.11-2.8.1.mjm.i386.rpm">php-pgsql-4.3.11-2.8..&gt;</A> 03-Apr-2006 22:05 51k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-snmp-4.3.11-2.8.1.mjm.i386.rpm">php-snmp-4.3.11-2.8...&gt;</A> 03-Apr-2006 22:05 27k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_i386/php-xmlrpc-4.3.11-2.8.1.mjm.i386.rpm">php-xmlrpc-4.3.11-2...&gt;</A> 03-Apr-2006 22:05 54k </pre> <p>Fedora Core 5 - <b>FC5</b> - <b>x86_64</b>, compiled with <b>GCC 4.1</b></p> <pre> <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-4.3.11-2.8.1.mjm.x86_64.rpm">php-4.3.11-2.8.1.mjm..&gt;</A> 08-Jul-2006 14:28 1.5M <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-debuginfo-4.3.11-2.8.1.mjm.x86_64.rpm">php-debuginfo-4.3.11..&gt;</A> 08-Jul-2006 14:31 5.4M <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-devel-4.3.11-2.8.1.mjm.x86_64.rpm">php-devel-4.3.11-2.8..&gt;</A> 08-Jul-2006 14:31 402k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-domxml-4.3.11-2.8.1.mjm.x86_64.rpm">php-domxml-4.3.11-2...&gt;</A> 08-Jul-2006 14:31 54k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-gd-4.3.11-2.8.1.mjm.x86_64.rpm">php-gd-4.3.11-2.8.1...&gt;</A> 08-Jul-2006 14:32 104k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-imap-4.3.11-2.8.1.mjm.x86_64.rpm">php-imap-4.3.11-2.8...&gt;</A> 08-Jul-2006 14:32 50k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-ldap-4.3.11-2.8.1.mjm.x86_64.rpm">php-ldap-4.3.11-2.8...&gt;</A> 08-Jul-2006 14:32 34k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-mbstring-4.3.11-2.8.1.mjm.x86_64.rpm">php-mbstring-4.3.11-..&gt;</A> 08-Jul-2006 14:32 910k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-mysql-4.3.11-2.8.1.mjm.x86_64.rpm">php-mysql-4.3.11-2.8..&gt;</A> 08-Jul-2006 14:32 36k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-ncurses-4.3.11-2.8.1.mjm.x86_64.rpm">php-ncurses-4.3.11-2..&gt;</A> 08-Jul-2006 14:32 41k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-odbc-4.3.11-2.8.1.mjm.x86_64.rpm">php-odbc-4.3.11-2.8...&gt;</A> 08-Jul-2006 14:32 42k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-pear-4.3.11-2.8.1.mjm.x86_64.rpm">php-pear-4.3.11-2.8...&gt;</A> 08-Jul-2006 14:32 348k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-pgsql-4.3.11-2.8.1.mjm.x86_64.rpm">php-pgsql-4.3.11-2.8..&gt;</A> 08-Jul-2006 14:33 51k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-snmp-4.3.11-2.8.1.mjm.x86_64.rpm">php-snmp-4.3.11-2.8...&gt;</A> 08-Jul-2006 14:33 27k <A HREF="http://www-personal.engin.umich.edu/~mirandam/resources/php4_fc5_x86_64/php-xmlrpc-4.3.11-2.8.1.mjm.x86_64.rpm">php-xmlrpc-4.3.11-2...&gt;</A> 08-Jul-2006 14:33 53k </pre> <!-- <p>Fedora Core 4 - <b>FC4</b> - <b>i386</b>, compiled with <b>GCC 4.0</b></p> <pre>Available soon...</pre> !--> <hr> <h3>Installation</h3> <p>Manually install all the RPM's that the system requires. For <i>example on <tt>i386</tt></i>:</p> <pre>[root@charon i386]# rpm -ivh php-4.3.11-2.8.4.mjm.i386.rpm \ php-domxml-4.3.11-2.8.4.mjm.i386.rpm \ php-gd-4.3.11-2.8.4.mjm.i386.rpm \ php-mysql-4.3.11-2.8.4.mjm.i386.rpm \ php-pear-4.3.11-2.8.4.mjm.i386.rpm \ php-xmlrpc-4.3.11-2.8.4.mjm.i386.rpm</pre> <p><b>NOTE:</b> The <tt>php</tt> and <tt>php-pear</tt> RPM's <b>MUST be installed at the SAME</b>. Most other RPM's can be installed separately.</p> <p><b>If RPM's were compiled</b>, then ALL dependancies will be met. It is recommended to remove any unnecessary RPM's (ex: <tt>postgres</tt>).</p> <p><b>If RPM's were downloaded</b>, then it is required to manually determine dependancies.</p> <p><i>Other Possible Idea</i>: Using <tt>yum localinstall filename.rpm</tt>, it is possible for <tt>yum</tt> to grab dependancies automatically. However on testing, this has <i>not been very reliable!</i></p> <hr> <h3>Updates</h3> <p>Updating through <tt>yum</tt> will update PHP4 to PHP5. The following changes are required to prevent <tt>yum</tt> from doing so:</p> <pre>EDIT: /etc/yum.conf ADD at the end of the file: exclude=php* </pre> <p>Presently, to maintain compatibility no updates on this page will be provided outside of any officially updated release by Redhat/Fedora or in the event of a security advisory. It is not recommended to rely on this page or any information provided here for production servers.</p> <hr> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- resource_banner_bottom --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5258443501063629" data-ad-slot="6814328088" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <h3>More Information</h3> <p>Most other ideas are available on the guide: <a href="https://www.mjmwired.net/resources/mjm-php4-fc4.html">PHP4 on Fedora Core 4</a> <p>Special Thanks to Jim Walters (jimw[at]<a href="http://www.bugopolis.com" target="_blank">bugopolis.com</a>) who provided the initial help on this guide.</p> <hr> <div id="helpout"> <p>Comments, suggestions, questions or any feedback welcome for this page or any of my <a href="https://www.mjmwired.net/resources/">Resources</a>. Please use the <a href="https://www.mjmwired.net/contact">contact</a> link.</p> <p><b>Help Out:</b> If you found this guide or any <a href="https://www.mjmwired.net/resources/">Resource</a> helpful, please consider <a href="https://www.mjmwired.net/support">supporting this site</a> by recommending this page to others or linking to this page. I appreciate all the support I receive. Thank you in advance.</p> <ul> <li>If you wish to thank me via <a href="https://www.amazon.com/hz/wishlist/ls/2EPXY2P66KUM1/ref=nav_wishlist_lists_1">Amazon.com wishlist</a>.</li> </ul> </div> <div><a name="disclaimer"></a></div> <div id="disclaim"> <p><b>Disclaimer:</b> 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.</p> <p><b>PLEASE DO NOT</b> mirror, translate or duplicate this page <i>without</i> contacting me.</p> <p><b><a href="https://www.mjmwired.net/copyright">Copyright &copy; 2003-2013</a> by Mauriat Miranda</b> (mjmwired.net).</p> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10