hi follow y tutorial install lamp but i got error E: Package 'php5-mysql' has no installation candidate how fix this .thanks for help

October 8, 2016 52 views
LAMP Stack Ubuntu 16.04

E: Package 'php5-mysql' has no installation candidate

3 Answers

Hi monu2jan. Ubuntu 16.04 comes with PHP7, so installing PHP5 takes some extra steps. If you were using a tutorial written for 14.04, it may not have been appropriate for the droplet you've created.

Is PHP5 a requirement, or can you work with 7?

I recommend creating a Droplet using the "One-click apps" option. There are LAMP droplets available there for 14.04 (PHP5) and 16.04 (PHP7). You can get started creating a One-click app here.

Hope this helps!


Hi @monu2jan ,

As of Ubuntu 16.04, PHP7 is default and recommended version. If you want to switch to PHP7 make sure that application is compatible with it (also it is recommended to test it before taking in production).

Anyways to install PHP5 you need to ad repository and install it.

  1. Add PHP repository

    • sudo add-apt-repository ppa:ondrej/php
  2. Refresh APT cache with

    • sudo apt-get update

    After it completes successfully, PHP5 is ready to be installed:

    • sudo apt-get install php5.6

    Please make sure when you want to install modules, specify it with php5.6.
    For example:

    • sudo apt-get install php5.6-mbstring
    • sudo apt-get install php5.6-mcrypt

    If you go with php instead of php5.6 it will try to install PHP7 version of module.
    Note: Make sure you delete older/newer version before installation

hi i am new about ubuntu i am working on magento project i want to install lamp+magento bcose magento new version is compatibale is ubuntu 16.04 32 bit please guide me how i will start
to install lamp i learn lot of tutorial but not acurate ans

Have another answer? Share your knowledge.