How to Install WordPress 4.7 On Ubuntu 16.10/16.04 Using LAMP Stack

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. Use our Hosting referral link if you planning to start your blog ($3.82/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.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

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...

40 Responses

  1. Mark Bills says:

    My wordpress setup page is not loading. I even tried the fix from Anthony K above. Any suggestions?

    “I also had to modify `/etc/php/7.0/apache2/php.ini`:
    From:

    short_open_tag = Off
    To:
    short_open_tag = On
    To get the browser to load the WordPress page.”

    • Aaron Kili says:

      @Mark

      There could be a an issue with your configs, try to check and make sure they are correct. Alternatively, if you have the default web server page(.html), try to remove it.

      • Evan Dempsey says:

        I removed the index.html page from /var/www/html/ but the default Apache page still shows up. I’ve followed all of the steps carefully and they have gone smoothly, but the WordPress setup page still doesn’t appear.

        • Aaron Kili says:

          @Evan

          Did you use the correct URL, if not try using the one in the screenshot.

          • Evan Dempsey says:

            Thanks for responding. I fixed the issue by reinstalling WordPress. However, I was working on developing a WordPress theme when I refreshed the page to see the changes I made, and suddenly every WordPress page I visit (including wp-login.php) is just blank. I’m not sure what happened, all I did before refreshing was create a .css file in my theme’s folder.

  2. Anthony K says:

    I also had to modify `/etc/php7.0/apache2/php.ini`:
    From:

    short_open_tag = Off
    
    To:
    
    short_open_tag = On
    

    To get the browser to load the WordPress page.

  3. george says:

    Thanks for the tutorial. Easy to follow. I did have a problem getting up the WordPress page when I entered http://server-address (in my case localhost). It bought up the apache default test page, so I had to go in and rename or delete the index.html file in /var/www/html. Page now comes up straight away.

  4. Paul says:

    The newest Ubuntu Server 16.04 LTS and their built-in LAMP stack required the following addition to the PHP section:

    $ apt-get install php7.0-cli
    $ sudo a2dismod mpm_event 
    $ sudo a2enmod mpm_prefork
    

    I’m not sure if that’s what solved my issue, or in combination with the following that I also did, before forgetting to restart apache2:

    $ sudo apt-get install php-fpm
    $ sudo a2enconf php7.0-fpm
    $ sudo service apache2 restart
    

    Disclaimer: I don’t know anything about Linux/UNIX/etc — I was just trying to get a little LAMP Ubuntu wordpress server going in Hyper-V. However, after PHP configuration, apache2 failed to start.

    Cheers!

  5. Ashok kumar says:

    Excellent its very helpful

  6. charlie says:

    I’m trying to get through this process on a fresh Linux mint os. Step 3, creating the info.php inside /var/www/html I do the sudo vi command and get asked for the root password into the file. But for some reason when i paste the code provided I get this. And am unable to even save the file.

    I have had success in the past installing, but everytime I see the Apache 2 Ubuntu Default Page, I’m right back to square 1. Could it be permissions? Or am I simply pasting this he wrong way? Any help would be greatly appreciated, even if you know another linux distribution that would ease the pain. I’m new to linux and had kali before mint, I like to keep it all open source as I cant really take the crap from windows anymore. Cheers and Thanks in advance.

    • Ravi Saive says:

      @Charlie,

      I think you not familiar with VI editor, better use nano editor to add the php code to info.php file under /var/www/html directory..

  7. Don McLaren says:

    Great tutorial kudos! Probably the most error free experience I’ve had, however a couple of things went wrong for me.

    1. WordPress was installed in my user folder and not /var/www/html
    2. /var/www/html didn’t have permissions to rename/delete wp-config-sample.php so had to use:

    $ sudo chmod -R 777 /var/www/html
    

    Thanks
    Don

  8. Jessie Jacques says:

    I’ve gone through this Tutorial twice, and I keep getting the “Error establishing a database connection” Error, what could I be doing wrong/ how can I fix it?

    • Ravi Saive says:

      @Jessie,

      Please make sure that your MySQL database is running and also make sure that you’ve added correct MySQL database settings in wp-config.php file..

      • Jessie Jacques says:

        I got it working, I was using the computer name in the host name slot, once i figured out the error of my ways I got it working, Thanks!

  9. Aniruddh Shandilya K says:

    After renaming wp-config-sample.php to wp-config.php you have mentioned “update it with your database system under MySQL settings section” where can i find it in Ubuntu ?

Got something to say? Join the discussion.

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

Join Over 300K+ Linux Users
  1. 202,035
  2. 9,267
  3. 38,621

Are you subscribed?