Mauriat Miranda     mjmwired

PHP4 RPMs for Fedora Core 4

EDIT (Dec 19, 2005): I have written a formal guide on PHP4 on FC4.

As a followup to my previous post about PHP4 on FC4, I decided to abandon PHP5 altogether. I spent some time to try and get the PHP4 src.rpm from FC3 to compile correctly in FC4. As it turned out neither the GCC4 nor the GCC3.2 included in FC4 would compile everything properly. So I decided to try GCC3.4 (which I installed from source long ago when first tweaking with FC4).

Anyways it worked. I have 15 RPM files which I don’t think I will upload unless someone really cares for them. I’ve only done this in the process of seeing if there is an advantage in using my own compiled RPM’s as opposed to using the FC3 RPM’s. Right now I don’t think that there is.

Recommended Method: In the end if you force uninstall all PHP5 RPM files in FC4, and then you install the FC3 PHP4 RPM’s, it does work.

[root]# rpm -e php-imap php-ldap php-mysql php-pear php

Install any PHP4 RPM you want from Fedora Core 3 Updates. Make sure to install the php and php-pear RPM files together.

Posted in: Apache, FC4, Fedora, PHP,

21 Comments:

  • vampire_janus on November 3, 2005 - 08:08 AM

    as for installing the php4 rpms from fc3 updates, you will have a hell lot of dependencies. but you can install all of it using yum.

    ie yum install libcrypt.so.4… (or something)

    just a question, what must i do for the apache conf? which is /etc/httpd/conf/php.conf

  • Mauriat on November 3, 2005 - 06:18 PM

    vampire_janus: Nothing is needed. The PHP4 RPM should do everything for you. Just make sure to restart apache and watch for any errors.

    [root@charon ~]# rpm -q –whatprovides /etc/httpd/conf.d/php.conf
    php-4.3.11-2.7
    [root@charon ~]# grep php /etc/httpd/conf/httpd.conf

    (blank: no output at all)

  • webxser on November 18, 2005 - 11:11 AM

    Does it mean only uninstall the PHP5 from FC4 with –nodeps and then install the PHP4 ? Any configuration required to do?

  • Mauriat on November 18, 2005 - 01:13 PM

    webxser: Yes, uninstall EVERY PHP5 RPM from FC4, then try to install the PHP4 RPMs from FC3. By “try” I mean that you may have some dependency problems which can be resolved with some standard FC4 RPMs (or via YUM). The configuration provided by the RPMs will work fine.

  • Mauriat on December 19, 2005 - 07:19 PM

    Dave: You are on the right track, just install openssl097a-0.9.7a-3 RPM and then try installing PHP again. It should fix the problem. It can be found on your CDs/DVD or installed with YUM or downloaded from a FC4 mirror.

  • Hassan on December 15, 2005 - 10:22 PM

    I’m realy new to Linux family can any one please write down all the command I’ll nedd like using src.rpm , uninstalling php5 and etc

  • Dave on December 18, 2005 - 01:01 AM

    Hi, I’m a newbie to FC4 and Linux too. I’m needing PHP 4 instead of 5 on my machine also so I’ve been looking for help on this subject. I’m not running a webserver - just something to develop on. Well here is what I tried so far with no luck:

    Uninstalled all the PHP 5 packages through yum.
    Downloaded the rpms you mentioned except for the postgresql ones for php4 to my home folder.
    I don’t run postgresql..so don’t need.
    then I ran rpm -Uvh *.rpm
    Error messages regarding dependency problems with the following so i installed them with yum
    libcrypto.so.4
    libss.so.4
    autoconf
    automake
    libc-client.so.0

    restarted apache…no luck with php test script.

    added this line to httpd.conf

    LoadModule php4_module modules/libphp4.so

    restart apache again…still no dice.

    I appreciate the help!

    -clueless Dave

  • David on December 30, 2005 - 10:10 AM

    Hi there,

    i have same error like vampire_janus

    I installed with –nodeps because php4 asks for libdb4.2 and fc4 uses db4-4.3 . so when i restart apache:

    Syntax error on line 6 of /etc/httpd/conf.d/php.conf
    Cannot load /etc/httpd/modules/libphp4.so into server: libdb-4.2.so: cannot open shared object file: No such file or directory

    how to solve this issue pls?

    i have webserver down atm so i’d like a fast answer dudes, lot of thks

  • Mauriat on December 30, 2005 - 11:11 AM

    David: Install the following RPM: compat-db-4.2.52-2

  • David on December 30, 2005 - 12:12 PM

    Hey! that works fine

    thks for fast answer :)

  • kitdekat on January 18, 2006 - 03:15 PM

    does anyone have an ideas on how to install PHP4 on a FC4 x86_64 system?

    when i try to get the php 4.4.x source code and configure/make/install it myself, then configure script will only see the */lib directories and none of the */lib64 directories when locating extensions. im halfway through re-writing the 105k-line configure script making it look for both lib and lib64 but am tired of digging back for every ‘not found’ message, ie:

    configure: error: libjpeg.(a|so) not found.

    because its it found perfectly fine in /usr/lib64/libjpeg.so and nowhere else.

    i was about to make tons of soft-links across to /usr/lib but was afraid of 32/64 conflicts later from other programs trying to share the libraries. are there any php x86_64.src.rpm’s or mod’d configure scripts floating around that ican use instead of rewriting my own?

  • Mauriat on January 29, 2006 - 06:18 PM

    Jim Walters: The Mysql dependancy is available.

    [root@charon ~]# rpm -q –whatprovides libmysqlclient.so.10
    mysqlclient10-3.23.58-6

    However the Postgres library is not directly available through FC4, since I understand that FC3 shipped with PG 7.4, while FC4 shipped with PG 8.0. For libpq.so.3, you could either go back to an older Postgres or search for a compatibility library. I’ve found: compat-postgresql-libs-3 via Bruno’s blog.

  • Jim Walters on January 29, 2006 - 03:15 PM

    I need to use the php-mysql and php-pgsql modules and am getting (I guess predictably) the following with the FC3 RPMs:

    error: Failed dependencies:
    libmysqlclient.so.10 is needed by php-mysql-4.3.11-2.8.i386
    libpq.so.3 is needed by php-pgsql-4.3.11-2.8.i386

    Is it possible to get your RPMs? Or more information about rebuilding the FC3 RPMs under FC4?

  • Jim on February 14, 2006 - 08:20 PM

    Argh:

    Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.d/php.conf: API module structure `php4_module' in file /etc/httpd/modules/libphp4.so is garbled - perhaps this is not an Apache module DSO?

    Anyone have ideas?

  • Mauriat on March 8, 2006 - 08:08 AM

    drayton: Yes, someone has confirmed this process works for x86_64. The pgsql dependancies are known, read above. I will try to verify the snmp dependancies later, but do you require this package?

  • drayton on March 8, 2006 - 08:08 AM

    this answers my previous question:
    ***I’ve tried downloading the x86_64 rpm on this URL:
    http://download.fedora.redhat.com/pub/fedora/linux/core/updates/3/x86_64/
    ***remove php5 using:
    yum remove php-mbstring php-snmp -php-imap -php-xmlrpc php-devel php-mysql php-pear php-ldap php-gd php

    ***intall php4 using rpm:
    rpm -Uvh *

    Note: installing php-snmp and php-pqsql have some dependencies. I didn’t intall those packages for the mean time. please post the solution if there’a any.

  • drayton on March 8, 2006 - 07:07 AM

    same with kidekat’s comment, does anyone tried ot on a x86_64 system, cause I’ve successfully downgrade my php5 to 4.3.10 on an i386 system. Unfortunately not on my x86_64 system.

  • Kripal on March 27, 2006 - 11:23 PM

    Hello,

    in my fedora core 4 php 4.4.1 was installed without GD so i followed your procedure and installled php 4.3.11 but after installation when i open any of my website it shows php 4.4.1 and through root phpmyadmin it shows 4.3.11 i have check configure of 4.3.11 it does not confgure with apache. so what i shold do to install rpm to compile with apache?

    if i have to remove php 4.4.1 as it is intalled by tar how i can do. Please help me on this regards

  • C.H. Lin on July 13, 2006 - 12:00 AM

    [who@where qq]# rpm2cpio php-snmp-4.3.11-2.8.i386.rpm | cpio -idv
    ./etc/php.d/snmp.ini
    ./usr/lib/php4/snmp.so
    43 blocks
    [who@where qq]# cp ./etc/php.d/snmp.ini /etc/php.d/snmp.ini
    [who@where qq]# cp ./usr/lib/php4/snmp.so /usr/lib/php4/snmp.so
    :)

  • Amy on April 3, 2006 - 01:13 PM

    Thanks for this thread! Just what I needed to get my sites back up :) (easier than php5-correcting all 20 of them!)

  • Denis Boudreau on July 22, 2006 - 03:15 PM

    Hi !

    I install PHP4 on my FC5 x86_64 machine following to information find here. I manage to get PHP4 to work, but the accent (&?eacute;, &?egrave;, &?ccedil;, &?agrave;, etc.) caracters doen’t appear in my web pages. I have mbsring install and in php.ini it is set to load.

    Thank you