Install WordPress on your home computer

I like to try new things with WordPress, but it's time consuming, and occasionally risky, to upload every incremental change or tweak to a remote web host for testing. Wouldn't it be great to have a local test environment with MySql, PHP, and WordPress?

After doing a little research, I discovered XAMPP, with Apache, MySQL, PHP, PHPAdmin, and Perl in one download, with easy installation for Windows, Mac, and Linux users.

The reviews were positive, so I decided to try XAMPP. However, I already use IIS and ASP.Net with Windows 7 on my 64-bit HP desktop, so I was concerned about the consequences of adding Apache server. (Yes, it's possible to install WordPress, MySQL, and PHP to work with IIS, but I did it this way to gain more experience using Apache server.) As it turned out, Apache and IIS7 can play well, if not really "together," on the same computer. See Running Xampp and Apache with IIS on my ASP.Net website.

The information here is mainly about using WordPress with XAMPP, where Apache is listening, as expected, on port 80 and IIS is not in the picture.

Install XAMPP

After downloading the zipped XAMPP package for your operating system, extract all files and double-click the executable file to install it. Be patient while unpacking the huge zipped file. I used xampp-win32-1.7.3.exe, since there is no 64-bit version. XAMPP installed successfully with no errors. All the software components are in one "umbrella" directory. If it becomes necessary to uninstall everything, that can be accomplished by deleting the XAMPP directory or running uninstall_xampp.bat. It does not make a mess on your hard drive.

After installation is complete, the XAMPP "web page" displays a success message in your browser (http://localhost/xampp/) along with information about the new services, programs, and admin tools. Use the XAMPP Control Panel to start the Apache and MySQL services. (I did not start Filezilla or Mercury since I don't need routinely need FTP or mail services on my home PC.) Click the Status link to see what is working, and the Security link to lock down your installation.

Create a database for WordPress

Before installing WordPress, open PHPMyAdmin and create a database for it. To do this, click the Privileges tab. Then click Add a new User. Type a user name, which could be WordPress, wp-blog, or whatever you want. Check the box to "Create database with same name and grant all privileges". Use the Generate button to create a strong password or make up a more memorable one. You will need to enter the password in your WordPress wp-config.php file, so type it into a text editor or copy the generated one to Windows clipboard NOW. Click Go. A screenshot from PHPMyAdmin is shown below (no, that's not the name of my database or password!)

Screenshot: PHPMyAdmin - Create User and Database

Before proceeding further, select the new database and click the Privileges tab to make sure the new user has been granted all database-specific privileges. If not, click the Add button and grant them. The new database has nothing in it yet. It will be populated with data tables when you install WordPress software.

Install WordPress

Get the latest stable version of WordPress from WordPress.org and extract the files to your XAMPP/htdocs folder OR to a new folder inside XAMPP/htdocs, if you prefer to keep the root uncluttered. Since this installation is a development tool just for you, set it up however you like. Then, save a copy of the wp-config-sample.php file as wp-config.php. Open wp-config.php in a text editor and update the following lines, replacing the values for DB_NAME, DB_USER, and DB_PASSWORD with your new database name, database username, and database password:

/** The name of the database for WordPress */
define('DB_NAME', 'putyourdbnamehere');
/** MySQL database username */
define('DB_USER', 'usernamehere');
/** MySQL database password */
define('DB_PASSWORD', 'yourpasswordhere');

Save the wp-config.php file and go to http://localhost/wp-login.php or http://localhost/yourWPfolder/wp-login.php to install WordPress. If you later decide to change the admin username from "admin" to something less vulnerable to hackers, open PHPMyAdmin and select your wordpress database. Open the wp_users table and change the username for admin to something hard to guess. There is also a plugin for changing the admin username, if you're squeamish about editing the database record directly.

I'm thrilled to have WordPress on my home PC, along with Apache and PHP. It's a great learning experience and especially convenient for testing navigation and layout changes. If I can do it, so can you!

Iframe in a post

As a test, I edited this post in the Visual editor, switched to HTML to add the iframe, and published. Never go back to the Visual editor after adding an iframe tag to a post because the TinyMCE editor will strip it out.

It’s advisable to install the tiny RawHTML plugin, if you use the Visual editor often. After you install it, you can use the short tag [raw](protected code here)[\raw] to preserve your code. I prefer to use the HTML editor routinely, and have the RawHTML plugin. However I did not enclose the <iframe> tag in this post with the plugin’s <!--raw_start--><!--raw_end-> special comment tags.

The alternative is to edit the TinyMCE config to add "iframe" to the allowed list of tags, but the config file will be overwritten when you update WordPress.

Link to product details in an aStore iframe

It’s easy to link to product detail pages in a standalone Amazon store, or to use the target attribute with a custom navigation menu on the same web page as an aStore iframe. But what if you have several product reviews on various pages of your site, and want to link to their [...]

BCPL tips and tutorials

As a volunteer with Friends of the Blount County Library, I'm happy to provide a little extra technical support for fellow users of TEL (Tennessee Electronic Library) databases and a growing collection of eBooks and audio books.

There is a link to BCPL Tips and Tutorials in the top menubar:

If your question is not answered [...]

Trying out jing

I have coveted Camtasia ever since I downloaded it as a 30-day trial several years ago, but couldn’t justify the cost. Last week, I discovered Jing. My goal was to find screencasting software for demos on how to access databases from a portal site. First I tried using my trusty copy of SnagIt, which [...]

Precise font-size and line-height

I love the flexibility of the Atahualpa WordPress Theme Options list, but I confess to making one change to a core file outside of the Options interface. I added a line to css.php to set the font-size of the root element to 62.5% so that the body font expressed in ems could be calculated [...]

Amazon Video on Demand Widget

Amazon has a Flash widget for previewing shows offered by its Video On Demand service. Amazon Associates may add the widget to web pages or blog posts. The first step in creating the widget is to select popular types of shows from a menu or choose items from keyword search results. The widget wizard [...]

Migrating to BlueHost

Right after signing up for web hosting services with BlueHost, I installed WordPress. After clicking WordPress on the CPanel, Simple Scripts took over and set up the files and database in moments. Nothing went wrong, so yay!

After installing the blog, I logged in to WordPress and used the Tools, Import panel to add [...]

Create an Amazon Image link

There are several ways to create Amazon image links in WordPress. This post describes how to download a product image from Amazon (or construct a direct URL to a product image), and then use the WordPress Upload/Insert Media wizard to upload the image (or specify the image URL), and create the image link.

Experienced web [...]

Amazon code without a plugin

Just paste the code into the HTML editor. It’s advisable to not use the Visual editor if the post is edited after saving. A plugin is not necessary, just convenient. For example, at left is a text+image iframe link. It has not been modified except to ensure that no line breaks are in [...]