How to Install LAMP with Apache, PHP 7 and MariaDB 10 on Ubuntu 16.04 Server

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

8 Responses

  1. John says:

    Excellent tutorial – worked without issue on XUBUNTU 16.04 which is a rarety.

  2. Bepo says:

    I got everything installed but phpmyadmin is in /etc instead of /var/www/html where it should have gone to I think. Also it didn’t accept my password for root. Can I reinstall phpmyadmin somehow? When I run the command for installing it, it tells me that it’s already the newest and cannot be upgreaded.
    Thank you.

    • Matei Cezar says:

      Use sudo dpkg-reconfigure phpmyadmin. No, by default, phpmyadmin installed from binaries does not use /var/ww/html directory for installation and uses /etc only for configuration . The source files reside in /usr/share/phpmyadmin usually.

      • Bepo says:

        I get the following error message when running the command you advised.

        ┌────┤ Configuring phpmyadmin ├─────────────┐
        │ An error occurred while installing the database: │
        │ │
        │ ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO) . Your options are: │
        │ * abort – Causes the operation to fail; you will need to downgrade, │
        │ reinstall, reconfigure this package, or otherwise manually intervene │
        │ to continue using it. This will usually also impact your ability to │
        │ install other packages until the installation failure is resolved. │
        │ * retry – Prompts once more with all the configuration questions │
        │ (including ones you may have missed due to the debconf priority │
        │ setting) and makes another attempt at performing the operation. │
        │ * retry (skip questions) – Immediately attempts the operation again, │
        │ skipping all questions. This is normally useful only if you have │
        │ solved the underlying problem since the time the error occurred. │
        │ * ignore – Continues the operation ignoring dbconfig-common errors. │
        │ This will usually leave this package without a functional database. │
        │ │
        │ Next step for database installation: │
        │ │
        │ abort │
        │ retry │
        │ retry (skip questions) │
        │ ignore │
        │ │
        │ │
        │ │
        │ │

        • Matei Cezar says:

          Choose retry (skip questions). If there are still issues with phpmyadmin, then completley remove the package with sudo apt remove –purge phpmyadmin and manually install phpmyadmin from sources.

  3. Philippe says:

    Found my problem , I did not execute this script because the purpose was not clear for me. After replacing the quote ’ by ‘ , I can execute those commands. Access to phpmyadmin is OK now, but I still don’t know why ;-)
    $ sudo mysql
    MariaDB> use mysql;
    MariaDB> update user set plugin=’‘ where User=’root’;
    MariaDB> flush privileges;
    MariaDB> exit

    • Matei Cezar says:

      Probably because you’ve used copy-paste the commands from here directly on mysql prompt. Always enter commands manually and pay attention to syntax, especially quotes.

  4. Philippe says:

    For phpmyadmin, if you “choose No on Configure database for phpmyadmin with dbconfig-common ” , you cannot “setup a strong password for the web interface”. You have to say YES then you can enter password.
    By the way, nice tutorial, even if I miss some explanation. At the end, just login into phpmyadmin gave me problem, as root or my user, can’t login.
    I will have to restart and look what is the problem,
    Thanks for your work

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.