I am trying to update my php from 5.3.10-1~lucid+2uwsgi2 (cli) to 5.4, but getting error. I am trying with the following command:

sudo add-apt-repository ppa:ondrej/php5

but getting the error:

Error reading https://launchpad.net/api/1.0/~ondrej/+archive/php5: couldn't connect to host

Could you please suggest how to do my update?

Thanks in advance.

  • 1
    I know this doesn't technically solve your problem, but 10.04 is really old. Perhaps consider upgrading to a newer/supported version of ubuntu
    – Joe
    Jul 21, 2017 at 22:51

1 Answer 1


Here's what you do:

Inside /etc/apt/sources.list we add

deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu lucid main 
deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu lucid main

And then we add his key and update the system

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5267A6C
apt-get update

Now, we can get the new PHP5.4!

apt-get install libapache2-mod-php5

Founded on https://gist.github.com/terwey/6416511

EDIT Seems like the package is not longer available as there is no more support for Ubuntu 10.04. See post https://askubuntu.com/a/419462/189996 and the comments.

  • and don't forget to remove the other repository from your source.list...
    – wittich
    Jun 19, 2015 at 11:33
  • I am getting gpg: keyserver timed out gpg: keyserver receive failed: keyserver error when run the apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5267A6C command Also please mention which repository I need to remove from source.list.
    – Srim
    Jun 19, 2015 at 13:17
  • If you execute sudo add-apt-repository ppa:ondrej/php5 it had added deb http://ppa.launchpad.net/ondrej/php5/ubuntu lucid main deb-src http://ppa.launchpad.net/ondrej/php5/ubunt lucid main This lines you should remove...
    – wittich
    Jun 19, 2015 at 13:22
  • About the key. If you hit apt-get update it should show you which key is missing... you can check manually if the key exists: keyserver.ubuntu.com
    – wittich
    Jun 19, 2015 at 13:27
  • Just found this: askubuntu.com/a/419462/189996
    – wittich
    Jun 19, 2015 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .