tags:

views:

3640

answers:

4

I'm tearing my hair out trying to get PHP 5.2.6 installed on our RHEL 4 box here. Upgrading to RHEL 5 is an option down the road, but not tonight, which is when we need to get this instance of our webapp that depends on a new build of PHP running.

Any advice in this vein is much appreciated! I've been working through suggestions made here: http://www.cyberciti.biz/tips/how-to-install-php5-redhat-enterprise-linux4.html But I'm not having much success.

+1  A: 

Quick version:

  1. Make sure you rpm -e all the PHP packages that RedHat provide.

  2. Download the tarball from www.php.net

  3. Untar it, cd into the directory and do

    1. ./configure
    2. make
    3. make install

You will need the normal build chain (gcc, binutils, make, autoconf, ...) plus Apache's dev library at the very very least. You might want to run ./configure --help first and see what options are available; a number of them will need extra dev libraries, such as for MySQL support. And some options might need configuring if RHEL4 has some directories different to what the build/install scripts expect.

staticsan
+1  A: 

Are you familiar with CentOS?

Basically, it's RHEL with all of the proprietary stuff removed.

CentOS also happens to have a repo called CentOS Plus that includes some upgraded kernels and namely PHP 5.1 and MySQL5.

If you can create a repo under /etc/yum.repos.d you should be able to add this and use yum to install the packages:

[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
CentOS Plus doesn't have PHP 5.2.6
Mark Biek
A: 

I ended up using the Utter Ramblings yum repository to install PHP 5.2 on my CentOS (which is, for all intents and purposes, RHEL).

Even if you don't want to use yum, you should be able to just download the RPMs.

I couldn't find any other PHP 5.2 RPMs or repositories that worked. Even CentOS Plus didn't seem to have anything beyond PHP 5.1.

Here's a direct link to the EL 4 repository files.

Mark Biek
Unfortunately, utterramblings has been unmaintained for over a year at this point. http://famillecollet.com/ is a popular alternative, but there's no guarantee it will continue to be maintained either.
Frank Farmer
A: 

well first you can configure up2date in RHEL4 to use yum repositories, in /etc/sysconfig/rhn/sources add a yum repo with the next line (for example to use the UtterRambling repo)

yum utterramblings http://www.jasonlitka.com/media/EL4/$ARCH

now for php5 inside RHEL4 you have the next alternatives:

  • UtterRambling repo, the problem with this is that was unmaintained for almost a year, but Jason Litka return to maintain this.

  • Remi Collet repo, this one is updated continously.

  • IUS Comunity repo, this one is special because try to not overwrite your own php4, install php5 alongside the php in your distro (the proyect is sponsored by RackSpace).

good luck!

P.D. i can't post links because i am a newbie in stack overflow but u can google easily by the name and go to the repo pages.

Black Hand