If you’re planning to develop websites in PHP, it’s inconvenient to have to set up remote hosting: you’re paying for your time, and dealing with the lag of uploading every change to a server somewhere else in the world. Better to have a local server that you can mess around with.
For any kind of web development, you need a web server, a database and a programming language. Generally there’s no reason to deviate from the standard: Apache, MySQL and PHP. Luckily there are packages that will install this for you; less luckily the process is made complicated by occasionally poor documentation. So let’s get the steps right and avoid the complications.
I’m making some choices for you. You can trust that I’m terribly clever and have looked into the options at length before finding the best possible choices, or you can just guess that I settled upon something that was good enough and couldn’t be bothered to change. A bit of both is true: I did try a few other options, on the advice of other web developers, but I gravitated back to what I know because it does seem to suit my way of working.
First choice: WAMPserver. It’s a French open source project, with its good and bad points. One of the worst of the bad points is that the installation instructions are translated from French, and the translators missed an essential paragraph, without which the rest is more or less useless. I did six years of French in high school and it’s quite a short paragraph so I worked it out, but to save you the trouble I’ll give you the steps myself.
Second choice: let’s not just install the latest PHP version (7.3.5 as of June 2019) but also a few older ones. PHP is famous for making major, breaking changes in minor point releases, and a lot of the service providers you will eventually install your finished products on are thus a little nervous about upgrading to the latest and greatest. So we’ll grab a late version of PHP 5 as well as a few point releases of PHP 7.
Third choice: assume WordPress. You can get benefit out of these instructions even if you’re not setting up a WordPress installation, but my primary focus will always be on getting WordPress to work so that’s what you’ll get here.
We start at the secondary repository of Wampserver files. This isn’t the official project page, but has their seal of approval. The first file you want is labelled Wampserver x.x.x yy bit zzz – Apache x.x.xx – PHP x.x.xx/x.x.xx/x.x.xx/x.x.xx/x.x.xx – MySQL x.x.xx – MariaDB x.x.xx, where the x.x.xx parts are various version numbers and the yy bit zzz part is your computer’s processor. Hardly anyone has 32 bit computers any more, so you’ll probably want 64 bit x64 there. Download it, but don’t install it yet.
The bit I alluded to above, the essential instruction that didn’t get translated into English, has to do with the support software that WAMPserver needs. The reason you don’t want to install the file you just downloaded immediately is because it doesn’t work without the support software. That software is provided by Microsoft, and is freely distributable but can’t be directly included in the installer.
(In fact it probably could have been included, and the reasons for not doing so used to make sense but are a bit redundant now, but this is a free project and sometimes you just have to sigh and accept that not everyone thinks the way we do.)
Scroll down to the section headed Tools, and download and run the program labelled Checks VC++ packages installed. This will save a lot of effort in the next step.
When you run that, you’ll get a big plain dialog box that, at least at first, will probably run off the bottom of your screen. It will list all the redistributable packages that need to be installed so that WAMPserver can run.
Now the game of Whack-A-Mole begins. Pick an item at random from the list. Go to the bottom of the repository page, and find the matching item. Download and install it. Then do it again, for each file in the list.
Sadly, you can’t install multiple files simultaneously. Every installation is a special snowflake that does not play well with others. By all means download as many at once as your net connection will allow, but when you install you install one by one.
It is true that you have to install the 32 bit packages, even on 64 bit Windows. The reasons for that are complicated and dull. Sigh and accept.
Eventually, you’ll run out of items on the list. You can close the popup, even if you can’t see the buttons, by clicking it and hitting Tab then Enter. Then you just rerun the program again, and carry on with the process.
Eventually, you will see this delightful message:
That means you can finally install the actual WAMPserver installer that you downloaded what feels like months ago.