Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jul 1 '12 at 22:26

This question came from our site for professional and enthusiast programmers.

    
where are you running into problems? –  Owen Oct 31 '08 at 2:16
    
Are you using up2date, yum, apt-get or installing from source? What is the specific problem you are having? –  cowgod Oct 31 '08 at 2:23

4 Answers 4

up vote 1 down vote accepted

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.

share|improve this answer

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
share|improve this answer
    
CentOS Plus doesn't have PHP 5.2.6 –  Mark Biek Oct 31 '08 at 2:33

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.

share|improve this answer
    
Unfortunately, utterramblings has been unmaintained for over a year at this point. famillecollet.com is a popular alternative, but there's no guarantee it will continue to be maintained either. –  Frank Farmer Apr 14 '09 at 1:28

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

For php5 inside RHEL4 you have these 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 project is sponsored by RackSpace).

Good luck!

P.S. I can't post links because I am a newbie on Stack Overflow but you can Google easily by the name and go to the repo pages.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.