0

My dedicated hosting provider has installed php-5.1.6-27.el5.x86_64 on my server whereas I would like PHP 5.3.3 installed (64 bit)

I can't seem to upgrade it at all

root@server [~]# php -v
PHP 5.1.6 (cli) (built: Mar 31 2010 02:39:17)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

root@server [~]# yum install php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Package php-5.1.6-27.el5.x86_64 already installed and latest version
Nothing to do

I think I have RHEL5, but I'm not sure where to verify this from:

root@server [~]# uname -r
2.6.18-194.17.1.el5

root@server [~]# cat /etc/issue
CentOS release 5.5 (Final)
Kernel \r on an \m
siliconpi
  • 1,707
  • 6
  • 30
  • 45

3 Answers3

1

Welcome to RedHat Enterprise (and clones, since CentOS is a free rebuild from RHEL SRPMs (mostly)).

The bad news is that what you have installed is the current version available to RedHat customers. This is more or less what was current when RedHat released version 5.0 three years ago.

RedHat Enterprise distributions are prized for their extreme stability, in that nothing(1) changes unless it is necessary to change. RedHat will provide security fixes, but other than that very little changes in the distribution. This means you can set up a server and don't have to worry about something changing underneath you during the lifespan of the system.

The worse news is that while you can install something newer, you lose much of the benefit of having the RHEL-based system. You get to worry about security updates, and potentially updates of those components which depend on (or depend on things which conflict with) your manually installed component.

I see there is a link to a 'blog post where someone has their own built copy of a newer version of PHP. This may indeed be what you want, but you'll then depend on this repository to stay up to date and be timely with fixes.

If you are up for either of those scenarios, you are off to the races.

If you want the stability and relatively-easy-to-update-ness of RHEL, I would consider trying very hard to make do with what is available in the stock distribution.

--

(1) Well except Firefox. And glibc. And...

David Mackintosh
  • 14,223
  • 6
  • 46
  • 77
  • I describe this as the "old and stable meets new and shiny!" problem. – David Mackintosh Oct 18 '10 at 07:31
  • Crap - and even if I want to 'take the risk' of installing / upgrading _just_ PHP? There is no way I can do that...?? Surely some way of upgrading that directly from php.net must exist? – siliconpi Oct 18 '10 at 07:52
  • @matt_tm - Sure, you build from source: http://www.php.net/manual/en/install.unix.php (if you're only familiar with installing precompiled binaries, you might want to read a few man pages on the topic before you get started) – danlefree Oct 18 '10 at 08:35
  • I'm doing just that and its an awful mess! – siliconpi Oct 18 '10 at 10:55
  • After installing 20-25 missing modules/dependencies, i got it to make but then make install seems to fail - see http://serverfault.com/questions/192006/is-php-make-install-working-fine-here – siliconpi Oct 18 '10 at 11:06
1

As has been mentioned, RHEL doesn't contain a newer version of PHP compared to what you've got installed so you've got two options:

Compile from source, goto php.net and download the source distribution, install all the build tools on your server (or far better, another box) and ./configure && make && make install. Then hope that you've got all the options you need for compatibility. Certainly not impossible, but you would need to weigh the flexibility against the requirement to build a new version each time you want to apply a security fix.

The other option is to use third party repositories, as you've realised there is an issue of trusting the binary packages that someone else is maintaining. We've recently had the same issue as you, developers here requiring a newer version of PHP than is officially supported by RedHat.

I ended up using the http://iuscommunity.org/packages/>repos @ http://iuscommunity.org. It's a project sponsored by RackSpace (who are at least fairly reputable) who provide RedHat binary compatible packages and security updates, they carry several versions of PHP including 5.3.3.

James Yale
  • 5,042
  • 1
  • 16
  • 20
  • Hi James - I'm still trying to figure this out... so what do I need to do next? There are a bunch of files at http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/repoview/ - how am i supposed to use them? Also, they say at "http://iuscommunity.org/getting-started/" that "Note: IUS Packages replace stock RHEL packages, however they do not obsolete them. Meaning, you can’t just ‘yum upgrade’ and get our packages… you need to first remove the stock RHEL package such as mysql, and replace it with the IUS package such as mysql51. " – siliconpi Oct 18 '10 at 10:44
  • You can just download the individual RPMs, but more useful is to add the repository to your yum configuration - there is a neat packaged way to do this too. Grab the epel-release (http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/repoview/epel-release.html) and ius-release (http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/repoview/ius-release.html) RPMs and install them (rpm -iv epel-release ius-release). – James Yale Oct 18 '10 at 13:58
  • After that when you 'yum search' it will include the iuscommunity.org repositories. You're quite right about the packages replacing the stock RHEL ones, you'll need to remove the standard RHEL php packages first, 'yum remove php*' worked for me when I did it. Finally you can then install the updated versions, 'yum install php53'. – James Yale Oct 18 '10 at 14:01
0

Try this link:

http://www.webtatic.com/blog/2009/06/php-530-on-centos-5/

Rosco
  • 455
  • 3
  • 6