Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Forgive me for such a newbie question, but in CentOS 5.3 or Ubuntu 8.04 / 9.10 what is the easiest way to install (and keep updated) PHP 5.3[.1] via yum or apt-get, respectively?

Thanks in advance!

share|improve this question
up vote 3 down vote accepted

Zend, who are the commercial entity behind PHP, have a set of yum/apt repositories that you can use to install and update PHP 5.3 on both Ubuntu and RHEL/CentOS.

There is a community edition that can be used however you like at no cost, although not all components are open source ("free as in beer" only).

To install you would add a Zend.repo file to /etc/yum.repos.d (or edit /apt/sources.list) and then do

yum install zend-server-ce-php-5.3


apt-get update
apt-get install zend-server-ce-php-5.3

Full instructions are at Choosing Which Distribution to Install

It includes an opcode cache (Zend Optimizer+) and a debugger (Zend Debugger) although these are perhaps not as widely used as APC or Xdebug, possibly because they are not open source.

It also includes Zend Framework and various extensions such as the php-java bridge, database drivers (not all of which are included in the normal PHP distributions) and a web-based management console.

There is also a commercial version which includes support and additional features.

share|improve this answer

The answer to your question is in your question: If you're using the distribution's packaged versions of Apache and PHP then you would install (and/or update) those packages by using yum or apt-get. If you're really new I would suggest aptitude (console/terminal) or synaptic (X11) on Ubuntu - those are both menu-driven and supposedly more friendly. I know equivalents exist on CentOS, but have no idea what they are :)

Re: Upgrading PHP, If your distribution has released a new package a yum update or apt-get upgrade will pick it up and install it (along with everything else that's out of date). If all you want to update is PHP (and leave everything else alone) then you would specify the PHP package at the end of those commands (e.g. yum update php).

Edit: this nice blog post gives details on how to add an apt repo with PHP 5.3.x in it since apparently Ubuntu doesn't have an official 5.3.x package for 9.10

share|improve this answer
I'm trying several distros but the package managers only show me PHP 5.2.6/8 while PHP 5.3.1 was already released a while ago as a stable version. I will try aptitude on Ubuntu. – Alix Axel Feb 5 '10 at 6:43
PHP 5.2.10 is the only version that comes up with aptitude on Ubuntu 9.10. =( – Alix Axel Feb 5 '10 at 6:50
Ahh - there's the rub: Ubuntu doesn't have official Ubuntu-ized PHP 5.3.x packages! Added a link to the answer which gives the magic incantations for getting 5.3.x going (not tested personally) – voretaq7 Feb 5 '10 at 7:20

For Ubuntu, see my answer here

(Basically, use these packages and you're good to go :) )

Hope it helps!

share|improve this answer

Your Answer


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.