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

I'm following this guide:

I've done all the steps, but it's still showing php 5.2.6 - any ideas?

I have also tried -cgi instead of -cli, neither have any effect.


I've tried rebooting the server to see if that would have any effect and unfortunately it didn't


Output of dpkg -l *php*:

| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                                          Version                                       Description
un  libapache2-mod-php4                           <none>                                        (no description available)
ii  libapache2-mod-php5                           5.2.6.dfsg.1-3ubuntu4.6                       server-side, HTML-embedded scripting language (Apache 2 module)
un  libapache2-mod-php5filter                     <none>                                        (no description available)
ii  php-pear                                      5.2.6.dfsg.1-3ubuntu4.6                       PEAR - PHP Extension and Application Repository
un  php4-cli                                      <none>                                        (no description available)
un  php4-dev                                      <none>                                        (no description available)
un  php4-mysql                                    <none>                                        (no description available)
un  php4-pear                                     <none>                                        (no description available)
ii  php5                                          5.2.6.dfsg.1-3ubuntu4.6                       server-side, HTML-embedded scripting language (metapackage)
ii  php5-cgi                                      5.2.6.dfsg.1-3ubuntu4.6                       server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                                      5.2.6.dfsg.1-3ubuntu4.6                       command-line interpreter for the php5 scripting language
ii  php5-common                                   5.2.6.dfsg.1-3ubuntu4.6                       Common files for packages built from the php5 source
ii  php5-curl                                     5.2.6.dfsg.1-3ubuntu4.6                       CURL module for php5
un  php5-dev                                      <none>                                        (no description available)
ii  php5-gd                                       5.2.6.dfsg.1-3ubuntu4.6                       GD module for php5
ii  php5-imap                                     5.2.6-0ubuntu5.1                              IMAP module for php5
un  php5-json                                     <none>                                        (no description available)
ii  php5-mcrypt                                   5.2.6-0ubuntu2                                MCrypt module for php5
ii  php5-mysql                                    5.2.6.dfsg.1-3ubuntu4.6                       MySQL module for php5
un  php5-mysqli                                   <none>                                        (no description available)
ii  php5-xsl                                      5.2.6.dfsg.1-3ubuntu4.6                       XSL module for php5
un  phpapi-20060613+lfs                           <none>                                        (no description available)
ii  phpmyadmin                                    4:3.1.2-1ubuntu0.2                            MySQL web administration tool


The following commands and their outputs:

grep php53 /etc/apt/sources.list

deb stable all
deb-src stable all

apt-cache search -f "libapache2-mod-php5"

update I've updated the question with more details on installed packages.

share|improve this question
How was php originally installed? Was it compiled from source? Where was it installed too? If you do "which php" what's the output? – AliGibbs Feb 15 '11 at 15:04
I have no idea - is there a way for me to tell? – Webnet Feb 15 '11 at 18:32
Please add the output of dpkg -l *php* in your question. – Lekensteyn Feb 15 '11 at 18:45
Can you do the following commands and post an update: grep php53 /etc/apt/sources.list and apt-cache search -f "libapache2-mod-php5" (please post the last output to link) – DrDol Feb 15 '11 at 22:11
I've updated the question with the results of those commands – Webnet Feb 17 '11 at 15:57

I ran some experiments on a virtual machine running Ubuntu 9.10, these are the working instructions:

Remove all previously dotdeb installed lines into /etc/apt/sources.list and insert this line only

deb oldstable all

Then you should update package list using aptitude update, after this you should be able to select the php5.3 package, but if you do that you'll find that it's broken because of missing dependencies. To correct this you should install manually this two missing packages by using wget and dpkg by typing this:

sudo dpkg -i libicu38_3.8-6ubuntu0.2_i386.deb
sudo dpkg -i libkrb53_1.6.dfsg.4~beta1-5ubuntu2_i386.deb

Now add the dotdeb gpg key to apt keyring with curl | sudo apt-key add - and then you will be able to select and install php5.3 with sudo apt-get install libapache2-mod-php. That's all, you have php 5.3.

share|improve this answer
When I try to update it says: ` The following packages have been kept back: libapache2-mod-php5 php-pear php5 php5-cgi php5-cli php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-xsl` – Webnet Feb 18 '11 at 14:00
Ok, this is because of other packages, I tried with a clean Ubuntu with no php installed. In your case you should use aptitude to fix this situation. Do you know how to do that? Otherwise I'll edit my post ASAP with instruction to do that. – Fabio Feb 18 '11 at 15:21… add the follwing links to source list – Roshan Aug 30 '11 at 11:13

The guide only updates the -cli package, which is the binary used when you run PHP from the commandline. I'm guessing that the package doesn't conflict with other versions of the CGI and apache module.

You need to install either php5-cgi or libapache2-mod-php5, whichever you're using for the webserver.

share|improve this answer
It's not finding a new version of PHP5-CGI – Webnet Feb 12 '11 at 15:53

apt-get upgrade php5 and apt-get upgrade libapache2-mod-php5

Then restart apache

share|improve this answer
Neither of those did anything 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. – Webnet Feb 12 '11 at 15:58

With the dotdeb packages you should indeed be able to upgrade. The page you mentioned only upgrades, as posted, the CLI of PHP. Follow these instructions instead:

And be sure to run sudo apt-get update before doing apt-get upgrade.

share|improve this answer
Plua - that's what we've done and apt-get upgrade doesn't find anything – Webnet Feb 14 '11 at 14:18

EDIT 2: You are correct in that none of this working! I just spun up a 9.10 VM and this does not work...i think something is wrong with the repositories...will get back to you shortly.

EDIT 3: I have for the life of me not been able to get PHP 5.3 installed on 9.10 using dotdeb repositories.

Is compiling from source an option? Is the machine in production use?

share|improve this answer
I've done all of that, the upgrade doesn't upgrade my php version when I do that. – Webnet Feb 15 '11 at 18:31
It is indeed in production use – Webnet Feb 15 '11 at 21:56
did you ever resolve this Webnet? – iainlbc Mar 4 '11 at 17:17
Confirmed... There is something wrong with the repositories. – lepe Mar 8 '11 at 7:19

In Ubuntu Lucid (10.04) you can do this:

Replace "lucid" for "maverick" in "/etc/apt/sources.list", and save it. Then open other terminal and execute aptitude, update sources and install/upgrade php5 files. This will update you to 5.3.3. Then undo ("maverick" to "lucid"), and save.

If you want 5.3.5 version, then use "natty" instead "maverick". I didn't have any package conflict, but I cannot warranty it would work perfect.

I hope it is useful.

I think Fabio's alternative is also good...

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.