Upgrade php on Ubuntu 14.04

Wordpress now requires php 5.6 or higher and I just can’t get it to update on my Ubuntu 14.04 droplet, I’ve tried dozens of tutorials but always get a Unable to locate package php5.6 or similar message.

Every tutorial is based around sudo add-apt-repository ppa:ondrej/php but nothing seems to work.

I don’t get any errors when adding the ppa and have also tried LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php adding the language packs etc, but no joy.

Have used the tutorials here, askUbuntu, Stack and anything else that Google throws up but always get the same Unable to locate message with no progress in resolving that either.

Any help greatly appreciated.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

I tried with php 7, 7.2 and 7.3 all of which gave me the same Unable to locate package message.

I also tried apt-cache search php and couldn’t see any php7 in there.

I’m pretty lower level with linux so am quite possibly missing something simple.

I’ve looked on Lauchpad and can’t see any reference to Ubuntu 14.04, would this be why it can’t find updates?

This comment has been deleted

    php 5.6 is verry old version of php. Wordpress will work with php 7.0 witch is in standard repo , or you can use above mentored repo to download 7.2 repo.

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    card icon
    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Sign up
    card icon
    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

    Learn more
    card icon
    Become a contributor

    You get paid; we donate to tech nonprofits.

    Learn more
    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

    Learn more ->
    DigitalOcean Cloud Control Panel
    Get started for free

    Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

    New accounts only. By submitting your email you agree to our Privacy Policy.

    © 2023 DigitalOcean, LLC.