Installing PHP5.3 on Ubuntu Jaunty

Update: I have added a new tutorial for installing PHP5.3 on Ubuntu Karmic.

I have recently dusted off an old laptop to play around with and do some “fun” development. One of the things I have done to this laptop is to install a LAMP stack using PHP 5.3 so I can play around and see what’s new and exciting.

I had a quick Google on how to install PHP 5.3 on Ubuntu and found Brandon Savage’s post on the very subject! Whilst he has a great write up it was one or two of his comments mentioning the DotDeb.Org package repository.

This was a breeze to use and in about 5 minutes I have PHP 5.3 running with Apache and MySQL on my clean Jaunty system.

The first thing to do is add the DotDeb.org repositories to your sources list:

$ sudo nano /etc/apt/sources.list
# php5.3
deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all

Now update and upgrade Ubuntu

$ sudo apt-get update
$ sudo apt-get upgrade

Now simply install apache mysql and php as usual

$ sudo aptitude install apache2 apache2-mpm-prefork mysql-client-5.1 mysql-server-5.1 php5 php5-cli php5-mysql libapache2-mod-php5

You will get a warning about untrusted packages being installed but this simply means that the PHP5.3 stuff is not signed, so I typed in “yes” and carried on. Obviously you can cater this line to your specific needs, but this is the basic stack up and running

When it was all complete I tested out my system:

$ php -v
PHP 5.3.0-0.dotdeb.8 with Suhosin-Patch 0.9.7 (cli) (built: Aug 12 2009 18:11:27)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

and tested out my apache installation using a phpinfo() script:

$ sudo nano /var/www/info.php

then fired up http://localhost/info.php
<?PHP
phpinfo();
?>

and saw as the main header of the page:
PHP Version 5.3.0-0.dotdeb.8

All done. Simple!

  • Pingback: Rob Searles » VMWare Server: Connecting to Guest via SSH

  • http://www.olivernassar.com/ Oliver Nassar

    Thanks. Thats what I was looking for :) Don’t wanna compile all the extensions and their dependent libraries in manually. Not worth the time.

    Happy Holidays Sir.

    • http://www.robsearles.com Rob Searles

      No problem Oliver, glad you found my post useful. Happy PHPing

  • http://www.olivernassar.com/ Oliver Nassar

    Thanks. Thats what I was looking for :) Don't wanna compile all the extensions and their dependent libraries in manually. Not worth the time.

    Happy Holidays Sir.

  • http://www.robsearles.com Rob Searles

    No problem Oliver, glad you found my post useful. Happy PHPing

  • jeffreymcmanus

    Very helpful, Rob, thanks for posting this.

    • http://www.robsearles.com Rob Searles

      No problem – sorry I’m just getting round to replying!

  • jeffreymcmanus

    Very helpful, Rob, thanks for posting this.

  • Adil

    On Ubuntu 9.10 the installation will not start because of broken dependencies :

    The following packages have unmet dependencies:
    libapache2-mod-php5: Depends: libicu38 (>= 3.8-5) but it is not installable
    Depends: libkrb53 (>= 1.6.dfsg.2) but it is not installable
    php5-cli: Depends: libicu38 (>= 3.8-5) but it is not installable
    Depends: libkrb53 (>= 1.6.dfsg.2) but it is not installable

  • robmorin

    Hey Rob, worked ok, for me, but had isues with installing php5-mcrypt i get the following error…

    root@mx1:/home/rob# apt-get install php5-mcrypt
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help resolve the situation:

    The following packages have unmet dependencies:
    php5-mcrypt: Depends: libltdl3 (>= 1.5.2-2) but it is not installable

    any ideas?
    Rob..

    • DracoBlue

      I have the same issue.

      Jan

  • robmorin
  • robmorin

    Hey Rob, worked ok, for me, but had isues with installing php5-mcrypt i get the following error…

    root@mx1:/home/rob# apt-get install php5-mcrypt
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help resolve the situation:

    The following packages have unmet dependencies:
    php5-mcrypt: Depends: libltdl3 (>= 1.5.2-2) but it is not installable

    any ideas?
    Rob..

  • robmorin

    Never mind found this post, helped me perfectly!
    http://www.dotdeb.org/2009/07/03/php-5-3-0-fina

  • http://www.robsearles.com Rob Searles

    Hi Robmorin,

    Thanks for this link. I’ll be having a look at installing PHP5.3 on Karmic when I get a spare sec, and seeming that Lucid will be out in a month and a bit, I might as well test it on the Alpha that’s now available!

    Thanks for posting the link

  • http://www.robsearles.com Rob Searles

    No problem – sorry I'm just getting round to replying!

  • http://www.robsearles.com Rob Searles

    Hi Robmorin,

    Thanks for this link. I'll be having a look at installing PHP5.3 on Karmic when I get a spare sec, and seeming that Lucid will be out in a month and a bit, I might as well test it on the Alpha that's now available!

    Thanks for posting the link

  • Pingback: Rob Searles » Installing PHP5.3 on Ubuntu Karmic

  • http://www.robsearles.com Rob Searles

    Hi Adil,

    Sorry for the slow reply. I have now added a new tutorial for installing on Karmic. See it here: http://www.robsearles.com/2010/03/17/installing
    Hopefully you'll find it works for you.

  • http://twitter.com/iromli Isman Firmansyah

    hi,

    it’s strange i couldn’t fetch libapache2-mod-php5 from dotdeb repo …

    any workaround? thx

  • http://twitter.com/izmanromli Isman Firmansyah

    hi,

    it's strange i couldn't fetch libapache2-mod-php5 from dotdeb repo …

    any workaround? thx

  • Clément Della Monica

    Thank you so much! what a time saver :)

  • Clément Della Monica

    Thank you so much! what a time saver :)

  • http://www.best-registrycleaner.net Best Registry Cleaner

    Very helpful, Rob, thanks for posting this.

  • http://www.best-registrycleaner.net Best Registry Cleaner

    Very helpful, Rob, thanks for posting this.

  • DracoBlue

    I have the same issue.

    Jan