How to install php 5 on ubuntu 16.04


In this tutorial we will show you how to install php 5, in this tutorial we will use version 5.6,  ubuntu 16.04 default repository comes with php version 7.0, unfortunately some web application doesn’t support this php version. We will guide you how to install php 5.6 in ubuntu 16.04 along with version 7.0 so you can switch php version anytime you want.

For you dont know PHP , PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. PHP widely use for web sites application right now.


Before you begin with this guide, you should at least have basic knowledge of linux, know basic shell command for linux, non-root user account with sudo privileges set up on your server. Also you have been installed apache and php in your server. If your server not installed apache and php you can follow How To Install Apache PHP on Ubuntu 16.04 Tutorial.

Step 1 – Add custom repository from ppa

We will add custom repository from ppa using command below

Step 2 – Install php 5.6

After we add custom repository we can install php 5.6 using command below

Step 3 – Switch php version

After finishing installation using apt-get you can switch php version using these command

Switch from php 7.0 to php  5.6

you can check using cli or open in your browser using php info based on Install php on ubuntu 16.04 Tutorial


Switch from php 5.6 to php 7.0 (If you want back using php 7.0)

you can check using cli or open in your browser using php info based on Install php on ubuntu 16.04 Tutorial


Congratulations , you have been successfully install php 5.6 on ubuntu 16.04. You can choose php 7.0 or php 5.6 just run switch command above. Right now your old php script shall be running well on ubuntu 16.04




You may also like...

9 Responses

  1. Brittney89 says:

    I see a lot of interesting posts here. Your content can go viral
    easily, you need some initial traffic only.
    How to get initial traffic?? Search for: masitsu’s viral

  2. KarolinkvVfw says:

    I see your website needs some unique articles. Writing
    manually is time consuming, but there is tool for this task.

    Just search for; Fasrixo’s tools

  3. Eugenio says:

    This site is really cool. I have bookmarked it. Do you allow guest posting on your page ?

    I can write high quality posts for you. Let me know.

  4. FastinOnline says:

    ny prescription discount card jeff hardy on drugs cambridge eye doctors franklin ma asus tf700t-b1-gr 10.1-inch tablet university of toledo college of pharmacy

  5. Mitch89 says:

    Reading your content is big pleasure for me, it deserves to go viral, you
    need some initial traffic only. If you want to know how to get it search for: blackhatworren’s strategies

  6. Gonzalo says:

    I see interesting posts here. Your site can go viral easily, you
    need some initial traffic only. How to get it?
    Search for: ricusso’s methods massive traffic

  7. Hi There! We are looking for experienced people that are interested in from working their home on a full-time basis. If you want to earn $200 a day, and you don’t mind creating some short opinions up, this might be perfect opportunity for you! Simply click the link here NOW!

  8. Angelaweify says:

    You always do the right thing. God Bless you.
    Thank you

  9. Susanlauct says:

    essay topics about mass media
    example essay on argumentative

Leave a Reply

Your email address will not be published. Required fields are marked *