How to Run WordPress Blog in Your Local Machine

A D V E R T I S E M E N T

In my previous post, I discuss how to set up a local web server using XAMPP. Now that we have the local server running, we are now ready to install any web platform called Content Management System (CMS) to our local computer. There are tons of CMS available out in the internet. You can purchase one if you like but there are thousands or maybe millions that are free. We have DotNetNuke, Joomla, Drupal, WordPress, PHP-Nuke, phpBB, Moodle, and MediaWiki to name a few. The most popular so far is Joomla. You can download them all if you want and try them all 'til you drop. But if you want to become a professional developer, master only one of the above because you have no enough lifetime to master all CMS.

The WordPress.org

This article is centered in WordPress. I chose WordPress as an example because this is the most widely used and the most popular platform among bloggers. WordPress is a very powerful platform in handling your blog articles, and the most appropriate platform if you do blogging. Note that I am talking about the software at WordPress.org. Most of the time, newbies mistakenly consider WordPress.com to be WordPress.org. Just click the links if you are not familiar with the two.

Define Your Database and Database User

The first step is to create a blank database. Imagine database as many drawers, each drawer holds folders, each folder holds bond papers, and records are written on the bond paper. If you did not understand what that means, it doesn't matter, the important here is we can create a blank database.
  1. In your browser window, type localhost/xampp
  2. In the XAMPP window, click phpMyAdmin
  3. In phpMyAdmin, type mywordpressblog in Create new database textbox, then click Create button. You can create any name you want, mywordpressblog is only an example.
That's it, very simple, you just created an empty database. Our next step is to create a user and give this new user a total control/access of the mywordpressblog database. Click the phpMyAdmin logo to exit from mywordpressblog database.
  1. Click Privileges tab and click Add a new User.
  2. In Add new User window, supply the following:
    1. User name: rtfverterra (you can use another name)
    2. Host: localhost
    3. Password: secret-password (you can use another password)
    Take note for the name of the database, username, and password, you need these things during the installation of WordPress.
  3. Click Go
We just created a new user named rtfverterra, the next step is to assign this user a full privilege to mywordpressblog database.
  1. Click again the Privileges tab.
  2. Look for the user rtfverterra and click edit privileges (it is a graphical icon that looks like a person and a pen)
  3. In Database-specific privileges in Add privileges on the following database: dropdown menu, select "mywordpressblog".
  4. Again in Database-specific privileges, click Check All.
  5. Click Go.
We just give the username rtfverterra full privilege to access the mywordpressblog database.

Install WordPress Manually

The next step is to install our CMS, we can actually use the database above to any CMS, in here we will use WordPress.
  1. Download the latest WordPress release from WordPress.org. Click here to download the tar file or visit the WordPress website for more information and if you want to download the zip file.
  2. Extract the file to the htdocs under XAMPP directory. Most likely it is at c:\xampp\htdocs or it is at C:\Program Files\xampp\htdocs depending on where you installed XAMPP. You need a software to extract the tar file, I am using WinRar. You can also use WinZip, but if you don't have any of these softwares, you can download the zip file, XP and Vista can extract zip files.
  3. After the file is extracted, be sure to place the folder wordpress under htdocs so that you will have the path \xampp\htdocs\wordpress.
  4. We can now run the set-up but at this time we will receive an error message. Type localhost/wordpress in your browser, you will receive a warning message. If you follow the steps given in this warning, you don't need to further read this post. Everything are available at WordPress.org.
  5. Look for the file wp-config-sample.php under wordpress folder and rename it to wp-config.php
  6. Open the wp-config.php using the Notepad or any text editor. Look for the following lines and replace it appropriately:
    1. define('DB_NAME', 'putyourdbnamehere'); replace putyourdbnamehere with mywordpressblog
    2. define('DB_USER', 'usernamehere'); replace usernamehere with rtfverterra
    3. define('DB_PASSWORD', 'yourpasswordhere'); replace yourpasswordhere with secret-password.
    4. Look for these lines: define('AUTH_KEY', 'put your unique phrase here'); define('SECURE_AUTH_KEY', 'put your unique phrase here'); define('LOGGED_IN_KEY', 'put your unique phrase here'); define('NONCE_KEY', 'put your unique phrase here');
    Go to https://api.wordpress.org/secret-key/1.1/ and copy-paste the generated keys in place of the above, and save your work.
  7. Type again in your browser the address localhost/wordpress. Hola! the WordPress setup is open. Happy blogging.
That's all folks. You successfully installed WordPress in your local machine. The process presented above is the same in your professional webhosting. You can now stop the use of Fantastico, most of the time, Fantastico will install an old version of your software.

Run Your Own Web Server Using Linux & ApacheRun Your Own Web Server Using Linux & Apache If you want an in-depth study of setting up webserver, I recommend you download the free 191 page preview of the book "Run Your Own Web Server Using Linux & Apache". The preview of this book is offered to us for free by SitePoint. It provides step-by-step instruction from installing Linux to common server administration tasks.



Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <pre> <h3> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
  _   _   _       ____      _   _  __  ____  
| | | | | | / ___| (_) | |/ / |___ \
| |_| | | | \___ \ | | | ' / __) |
| _ | | |___ ___) | | | | . \ / __/
|_| |_| |_____| |____/ _/ | |_|\_\ |_____|
|__/
Enter the code depicted in ASCII art style.