What led to this:
In February of 2012, I had two wordpress sites, built with the techozoic theme, which were broken for a variety of reasons, including a backlevel of techozoic and an importbuddy done without first deleting the files.
What I decided to do about it:
I thought that a good remedy would be to set up a WAMP environment for the purposes of debugging, and so that in the future, I would have a test server (also known as a staging server.)
Because I want to ultimately have two websites in WAMP, I will runa single install of Apache, MYSQL and PHP and then I will set up two different instances of my wordpress install.
How to later add the second website:
Whenever you want to add another website, it is as simple as creating another folder in your c:\wamp\www folder.
For more information:
See this website: http://sixrevisions.com/web-
The specs:
(It’s important that the PHP versions be as close as possible to that of the live server, but especially the PHP version in WAMP should not be far behind that of the production server. The WordPress versions must match exactly. The Apache and Mysql should be as close as possible.)
- WordPress 3.3.1 in both
- PHP 5.2.17 in Production, PHP 5.3.9 in WAMP
- Apache 2.2.21 in both
- Mysql 5.1.56 in production, 5.5.20 in WAMP
Starting on Valentine’s Day, 2012, I set out on these steps to rebuild my mikemoran.com site in WAMP. These instructions developed and morphed over time. This post serves as documentation for myself of what I did. If it helps someone else, that’s great.
- Set up WAMP
- Note in advance that Secunia will probably flag elements of WAMPSERVER. It is not necessary to put the patches on unless you plan to use WAMP to support a live site.
- Download and install WAMPSERVER in the default directory C:\wamp
- Point your browser at localhost http://localhost to see the default server configuration page.
- Create a directory for the mikemoran website files c:\wamp\www\mikemoran.com
- Go to localhost to see that mikemoran.com is listed under “projects.” Then go to http://localhost/mikemoran.com
- Install WordPress
- Download the latest WordPress zip file, and extract it into the mikemoran.com subdirectory of www.
- Visit http://localhost, then under Aliases,click on phpmyadmin to create a database. Use the same name as that on the production server.
- Visit http://localhost/mikemoran.com/wordpress to start the WordPress install.
- When it says you have no config file, then click on the button that says “Create a configuration file.” You will be able to match it to the server later.
- When you get to the database screen, set the database name, set the MySQL username to root, and don’t set a password. Leave the other defaults. Click “submit.”
- Click “Run the install.” Put in the site title and the same usernames and password as that on the production server.
- Click “install wordpress.”
- Go back to phpMyAdmin to check for the presence of your database tables
- Set PHP Config settings to be exactly what you have on the live production site (in php.ini). If you can’t see the contents of the php.ini file directly on the server, then you can run this php file:
<?php phpinfo(); ?>
Then navigate to that file in your web browser, and you will see the needed information. The instructions I found said that the most important thing is to make sure that safe_mode is set, and magic_quotes_gpc is set. I found them to be set to off on my live server, so I left them off in my WAMP installation. To compare it to the WAMP php, click on the WAMP icon, click on “localhost” and then click “phpinfo” which is under the Tools category. - If you see from the php.ini file that you have a different PHP version on the live server than you do on WAMP, then change your wampserver PHP to match the one on the server, but at worst, it really ought to be at least PHP 5 on the server!
- To get pretty URL’s, enable mod_rewrite: click on the WampServer icon in the taskbar, mouse over Apache and then Apache modules. Find rewrite_module in the list and click it. You will need to then click Restart all services to start using mod_rewrite.
- Create a MySQL user with the same details as our live server’s WordPress MySQL user. To do this, browse to http://localhost/phpmyadmin again and click on your WordPress database to select it (you only have one database so this should be easy).Next, click on the Privileges tab at the top of the screen, and then click Add a new User. Give the new user the same name and password as your live MySQL user. Use localhost. Click the Check All option at the bottom, which grants my new MySQL user all privileges. Click “go.”
- Configure the wordpress install: We will edit the WordPress config file (wp-config.php) to match the new database details.
Now we have a local website that has the same configuration as your live server. - Move the wordpress installation to the root so there’s no longer a wordpress folde
- Configure the admin pages. In settings–>general, cange the URL’s to http://localhost/mikemoran.com. Scroll down all the settings in your wamp wordpress installation, and match them to the live server.
- Install the latest version of techozoic
- Install all the plugins
- Copy the style file from the “custom css” plugin into the techozoic custom css.
- Create a zip file database backup from our current production site
- Backup the existing WAMP database
- Use importbuddy to import the backed up mikemoran database
- If there are errors, then remove the database and restore the backed up WAMP database. Then research how to pull in only the pages and posts.