Download WordPress from an FTP Server and Run it in XAMPP Local Host

This is the second part of a two-part tutorial. The first part was titled “Install and Run WordPress in XAMPP Local host.” In this article, I will detail the procedure for running your website right in your XAMPP local host. The purpose is to do on-site work on the local host so that it won't interrupt the normal website operations in your actual FTP server.

Contributed by
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
September 16, 2009
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

Any on-site work will be applicable, such as:

  • Doing search engine optimization work.
  • Improving functionality for customers by adding some new features.
  • Improving the website banner and logo as well as adding new content.
  • Testing a plug-in or any new scripts.

Before you can implement this daunting task, make sure you have all of the following:

  • A fully running WordPress website (completely running with plug-ins) in a Linux-based Apache server.
  • A fully functional WordPress MySQL database.
  • FTP access to your website.
  • A MySQL user name and password access.
  • Access to the WordPress wp-admin dashboard panel (user name and password).
  • Full access to your web hosting account.

If you are missing one or more of these requirements missing, ask your web hosting agency to provide the details. If you cannot obtain even one of those requirements, you will find it very difficult or impossible to run WordPress locally.

Download vital WordPress files from FTP server to your desktop

With the help of your favorite FTP client, connect to your website's FTP using your FTP username and password. See example. 

If your domain name is: WWW.MADMAXALIENS.ORG

Site Name: Madmaxaliens

Host / IP/ URL: ftp.madmaxaliens.org

User name: yourusername

Password: yourpassword

Port : 21

Timeout: 60

Retries: 2

Create a folder in your desktop with your domain name as the folder name. If your domain is www.madmaxaliens.org, the name of that folder in your desktop should be "madmaxaliens."

After connecting, press Control A to select all files in your WordPress FTP server. See screen shot below (right side of your FTP client for the hosting files). The vital files are highlighted, while those that are unnecessary are not highlighted.

Do not include the following files in the selection:

a. php_uploads

b. stats

c. _db _backups

These are heavy files and not necessarily important to running your WordPress site in your XAMPP local host. Remember that these types of files/file names might change from one hosting company to another. So consult with your hosting company for the equivalent files.

On the left side of your FTP client is the view of your local computer. Navigate through the folder you have created on your desktop so that those files from your FTP will be downloaded to that specific folder on your desktop.

The download path should look like this:

C:Documents and SettingsCodexmDesktopmadmaxaliens

Where "madmaxaliens" is the folder name in your desktop. After downloading files from the FTP, they will be saved inside that folder.

After selection of those vital files, right click and download. Note that the download button might be different for different FTP clients.

Download your website's entire WordPress MySQL database to your desktop

Okay, this step requires access to you WordPress MySQL database. Once you log in to phpMyAdmin, it will display the dashboard as shown below:

Then follow the procedure below:

  1. Click "Database."
  2. Locate the name of the WordPress database and click it.
  3. Click "Export."
  4. Click "Save a file."
  5. Make sure that the export file type is set to "SQL." Leave others as they are. 
  6. Finally, when all are set, click "Go."
  7. If you are using Firefox, a dialog download box will appear; save it to your desktop.

Configure database and import it to XAMPP phpMyAdmin

Once you have successfully downloaded the database to your desktop, log in to your localhost database: http://localhost/phpmyadmin, and then supply your login username and password.

After that, under "Create New Database,", enter the exact database name and then click "Create." Just leave it as it is first; we still do not need to import anything as of this moment.

In your desktop, copy and paste the entire FTP downloaded WordPress files folder "madmaxaliens" (this is an example only) to C:xampphtdocs, so that after copying the Windows file path of the folder will now be: C:xampphtdocsmadmaxaliens

Okay, under the "madmaxaliens" WordPress folder, find the "wp-config.php" file. Open it using your favorite PHP editor, and then change the database settings to the one that used by your local host.

For example, If I have the following local host database details:

Local host Database name: madmaxaliens

Local host Database Username: madmaxaliens

Local host password: passwordxxx

Local host host name: localhost

Find the following lines, the same as the example PHP script lines below and revise them according to your own access details:

define('DB_NAME', 'madmaxaliens');

define('DB_USER', 'madmaxaliens');

define('DB_PASSWORD', 'passwordxxx');

define('DB_HOST', 'localhost');

Leave the others as they are. Do not change anything except the above lines.

Finally save it.

Install WordPress and delete default WordPress MySQL tables

After configuring the database and copying the WordPress files to the htdocs XAMPP folder, copy the URL below in the browser and then press Enter:

http://localhost/madmaxaliens/wp-admin/install.php

Supply the blog title, Madmaxaliens , and also your email address. Since we are running at local host, we do not need this to be found by the search engines, so uncheck "Allow my blog to appear in search engines like Google and Technorati."

After that, click "Install WordPress." Okay, when you go to http://localhost/phpmyadmin, WordPress creates the standard MySQL database. Take note: THIS IS NOT YOUR WEBSITE DATABASE.

So what you will do is go to MySQL and delete each of the created tables ONE BY ONE (Do not delete all of tables together, as you will end up deleting the MySQL database also). These are the default tables:

wp_comments

wp_links

wp_options

wp_postmeta

wp_posts

wp_terms

wp_term_relationships

wp_term_taxonomy

wp_usermeta

wp_users

If other tables appear, delete them also. You can easily delete each table by using the "Red X" symbol beside the trash box symbol. After deleting, click "Structure" to see the other tables again. After deleting all default tables, you should see "No tables found in database."

Import the actual downloaded website MySQL database

Follow the steps below to import the downloaded MySQL database to XAMPP:

  1. Click "Import" in the phpMyAdmin.
  2. Click "Browse" and then locate the SQL file on your desktop.
  3. Make the sure the format of the imported file is "SQL." Leave the others as they are. 
  4. Click "Go" to import the file. 5. Click the MySQL table (under the database: "Madmaxaliens") with the name "wp_options" and change "Option value" to:

Site URL: http://localhost/madmaxaliens/

Home: http://localhost/madmaxaliens/

Edit the .htaccess file in the localhost

This is the original .htaccess syntax used in your FTP server:

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

# END WordPress

If you still use this one as the syntax of the .htaccess WordPress localhost, you will get a 404 header status (page not found) for your inner pages. This is because the reference with respect to the root / (which is true in your web host) does not anymore apply.

So you have to edit the .htaccess file to reflect the new root location of your blog at the localhost: http://localhost/madmaxaliens/

So open the .htaccess file under your folder in htdocs and edit to (example only:)

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /madmaxaliens/

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /madmaxaliens/index.php [L]

</IfModule>

# END WordPress

Then save it as .htaccess

Editing the files

You can now start viewing the localhost version of your WordPress website. If you like you can even log in to the Admin panel. Just type in:

(example:)

http://localhost/madmaxaliens/wp-admin

Then use the actual user name and password that is used in the live/web host version of your WordPress.

blog comments powered by Disqus
BRAINDUMP ARTICLES

- Microsoft Windows 8 Committed to Cloud Compu...
- Independent Developers Favor Windows Phone 7
- Dell Introduces VMware-based Cloud
- Microsoft and Skype Agree to Acquisition Deal
- Transfer Contacts in Microsoft Outlook
- Zune`s Next Steps
- Safari Books Online Review
- Does Microsoft Get Touch Screens Now?
- Microsoft`s Record Quarterly Earnings Not En...
- Basic Operations and Registers in Assembly
- Assembly Coding within Visual C/C++ IDE
- New Microsoft Office Coming with a Twist
- Microsoft`s FUSE Labs Unveils Spindex Social...
- HP Slate with Windows 7: Dead or Alive?
- Windows Phone 7 Mobile OS to Rival Android a...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials