Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 just upgraded PHP to V5.4 on my laptop, using the technique described in this answer, How do I install latest PHP in supported Ubuntu versions (like 5.4.x in Ubuntu 12.04)?.

I did the same for my desktop a while back and it all worked fine. On my laptop however the old version (5.3.10) is still showing at the CLI (php -v) and the SAPI (phpinfo()). why is it so?

Presumably there is a config file (or two) that needs updating?

I am using Ubuntu 12.04.

EDIT: output of dpkg -l '*php5*' as requested: (sorry about the formatting)

| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
ii  libapache2-mod 5.3.10-1ubuntu server-side, HTML-embedded scripting languag
un  libapache2-mod <none>         (no description available)
ii  php5           5.3.10-1ubuntu server-side, HTML-embedded scripting languag
un  php5-cgi       <none>         (no description available)
ii  php5-cli       5.3.10-1ubuntu command-line interpreter for the php5 script
ii  php5-common    5.3.10-1ubuntu Common files for packages built from the php
ii  php5-curl      5.3.10-1ubuntu CURL module for php5
ii  php5-dev       5.3.10-1ubuntu Files for PHP5 module development
un  php5-fpm       <none>         (no description available)
ii  php5-gd        5.3.10-1ubuntu GD module for php5
ii  php5-gmp       5.3.10-1ubuntu GMP module for php5
un  php5-idn       <none>         (no description available)
un  php5-imap      <none>         (no description available)
ii  php5-intl      5.3.10-1ubuntu internationalisation module for php5
un  php5-json      <none>         (no description available)
un  php5-ldap      <none>         (no description available)
ii  php5-mcrypt    5.3.5-0ubuntu1 MCrypt module for php5
un  php5-mhash     <none>         (no description available)
ii  php5-mysql     5.3.10-1ubuntu MySQL module for php5
un  php5-mysqli    <none>         (no description available)
un  php5-mysqlnd   <none>         (no description available)
un  php5-pgsql     <none>         (no description available)
un  php5-sqlite    <none>         (no description available)
un  php5-sqlite3   <none>         (no description available)
un  php5-suhosin   <none>         (no description available)
ii  php5-xdebug    2.1.0-1        Xdebug Module for PHP 5
ii  php5-xmlrpc    5.3.10-1ubuntu XML-RPC module for php5
ii  php5-xsl       5.3.10-1ubuntu XSL module for php5

ANOTHER EDIT: Problem solved

Hi, Ubuntu suddenly decided it had numerous other updates to apply, including a kernel upgrade, so I let that happen and we now have v 5.4! (The CLI is saying it can't load xdebug, but I've seen this before and should be able to sort it out. If I can't I'll raise another question).

share|improve this question

migrated from Jun 6 '13 at 13:03

This question came from our site for system and network administrators.

Did you restart apache, or the web server you are running? – NickW Jun 6 '13 at 8:51
Yep, restarted the laptop. – Kim Prince Jun 6 '13 at 12:37
please add output of: dpkg -l '*php5*' – oerdnj Jun 6 '13 at 20:30
up vote 1 down vote accepted

See last edit above. Basically, Ubuntu needed to install some updates, and once this had happened, php 5.4 was in use.

share|improve this answer
Please flag the question as answered (You always need to do apt-get update && apt-get (dist-)upgrade). There should be a php5-xcache package in my PHP PPA prepared for PHP5.4 as well, so it might be a matter of installing php5-xcache (apt-get install php5-xcache). – oerdnj Jun 7 '13 at 8:55

Since you were using ubuntu, you could've just done an update using aptitude or apt-get. Eitherway, you need to update httpd.conf and make sure that php5_module points to the place where your new php is.

LoadModule php5_module modules/

The reason why it still points to an older version of php might be due to your computer having multiple copies of php.

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.