This is a key post topic and so I will add more links to my content and external links to this over time. I will also keep a list of all the linked articles at the end of the post for reference.
Disclaimer: The setup is free, but I use one premium tool to make the migration of data from the live site to the test site easier. It is the Migrator Addon to the Updraft Plus Plugin (currently around £25 a year for me) You don’t need it, but it makes things easier – Read more here
The full list of Software I use is;
- WAMP SERVER a Windows based, web development environment.
- Filezilla, an FTP client for file transfers.
- Netbeans IDE, not required, but this is a code development application. Otherwise, the system suggests notepad for small changes.
- Updraft Backup Plugin with Migrator Premium Add-on
Preparing your system. (optional but recommended)
OK, sorry for hitting you with a daunting piece of work here. You can just ignore it and maybe you won’t have any problems. But, if you are going to jump around PHP versions, then you will need the Visual C version installed on your PC that relates to it. So, easier to just install them all up front.
You can read the WAMP explanation for it here
Before we install anything we need to check you have all the Microsoft compilers runtime installed. These are needed by different versions of PHP, so its good to get them all in. If you ignore this step then you may find some versions of PHP crash. If you do not know if your system is 32bit or 64bit then install everything 32bit.
— Make sure your system has “up to date” versions of ALL these redistributable packages:-
— Microsoft Visual C/C++ Redistributable 2008 (VC9),
— Microsoft Visual C/C++ Redistributable 2010 (VC10),
— Microsoft Visual C/C++ Redistributable 2012 (VC11),
— Microsoft Visual C/C++ Redistributable 2013 (VC13),
— Microsoft Visual C/C++ Redistributable 2015 (VC14)
Installing an IDE
(optional if you’re going to do lots of programming)
If you are going to do coding then you should have an IDE installed. Maybe you already do have. This is simply an editor built to edit code. If you are just going to cut and paste a few lines of code now and then, then the suggested notepad will be ok. Do not use Microsoft Word or other word processors. They mess up the file format.
My personal choice for IDE is currently Netbeans IDE, although I also use DreamWeaver from Adobe.
Installing WAMP Server
Download the 32bit or 64bot version to your desktop and then run the software as administrator. I suggest you use the default directory of C:/WAMP. If you are not sure, install the 32bit version.
During installation, you will be prompted for an IDE and browser. This gives you the chance to change from the default of notepad and Microsoft explorer. My choices were NetBeans IDE and Google Chrome.
Adding another version of PHP, Apache, MySQL.
The whole reason for having this local installation is to check and validate setups before using them on the live site. Therefore I want to be able to switch between different versions of PHP at least. You can install any version from PHP 5.3.29 to PHP 7.1.4 (at the time of writing this), and both as 32-bit and 64-bit versions. Make sure you install the version to match you WAMP install. (all 32-bit or all 64-bit).
I installed PHP 7.0.1 x64 which is what my host currently uses, and PHP 7.1.4 x64, the latest available. You may also want to match the version of apache used and install those too.
None of these added versions takes precedence on the system until you manually change them. From the WMP server, you can choose PHP, then version and select the version to become active. The same method works for MySQL and apache.
You can now install a virtual site.
From the Localhost page, you can choose to add a local host. You then just need to specify three things.the file location, the
The file location,
Keep within the C:/WAMP/WWW directory. If this is a fresh install, then copy the files for WordPress. The wp-config.php must be missing as we want WordPress to set this up for us. You could download a whole site into here. But still remove the wp-config.php file.
You can specify one on 127.x.x.x, unless you change WAMP settings to allow IP’s outside that. This could give you the chance to share the installation with other devices on your network. Excellent for testing multiple systems including mobile phones etc. You will need to add the IP address to your network adapter too.
This url will be added to your hosts’ file which means your machine only will see this URL as a valid one and match it to the IP address you gave above.
Create the Mysql Database
You need to declare a database for WordPress to setup into. Startup PHPMyAdmin and add a new database. The username on login is root and the password is blank. (nobody can access this outside your PC)
on your new URL and you will have the famous 5-minute setup. You know the database name you setup. The password for MySQL and you just need a username and password. For the standard installation this site can only be seen on this PC, so don’t fret about login details. I just use admin, admin.
Everything is now ready
You can install plugins and themes as usual. You can even use a backup plugin to restart another version onto this install. This is where the migrator addon for Updraft plus comes in handy. It will install the database and convert all the URL settings to the new site.
Check your PHP etc
Once your site is ready, you can change the PHP version to any you have installed by simple using the WAMP menu. instantly able to check that this version does not break your site. Make sure you test admin setups, user and any special pages for a complete check.