Setting up WAMPServer in 2024

I have been wanting to try out some PHP scripts for posting to a WordPress site from Ton Ziljstra (see this page for background, and Github for the scripts). I have a Windows laptop, and have used WAMPServer on previous laptops so I chose WAMPServer (download link). I noticed when I started the install that there were some Visual C redistributable files that also needed to be installed (see bottom of this page). I went to the release page and downloaded the latest version of the VisualCppRedist_AIO_x86_x64.exe file and used “Run as administrator”. This application installs multiple Visual C executables, and takes several minutes to run. You will see a number of windows open and close. When the installation is complete, there will be a splash screen indicating that all files have been installed. This might be behind other windows, so you may want to monitor the icons in the Windows app tray at the bottom of the screen to see if there is an icon you do not recognize.

After the installation, it is a good idea to run this checking app to confirm that all necessary Visual C files were installed correctly. I ran this and got the message that all installations were complete.

Finally, I started the WampServer installation by double-clicking on the EXE file I had downloaded to start. There are several checkboxes to accept the license, the location of the installation, and default web browser and text editor, but other than that, the installation took care of itself. To start WAMPServer, I double-clicked on the icon on my desktop (titled “Wampserver”). A splash screen indicated after 10-15 seconds that all server apps were running. I started Microsoft Edge and typed “localhost” in the address text, and got a “main screen” with info on the server apps.

Finally, I wanted to create a test PHP file to make sure that the server was working. I used the following source code:

<!DOCTYPE html>

<html>

<body>

<?php

echo “My first PHP script!”;

?>

</body>

</html>

I saved this in a file called hello.php, and copied it to C:\wamp64\www. I then changed the URL in the browser to localhost/hello.php and saw the following:

Now I am ready to start doing some PHP testing!

Setting up WordPress on WAMPServer

After getting the web server part of WampServer working, I wanted to install the latest version of WordPress (version 3.8) and the FavePersonal theme by Alex King. I wanted to play with it before installing it on my regular website. I decided to search for some examples on installing WordPress on WampServer. The best one was on WPBeginner.com, but I still had to get some other information to complete the installation. When the post talked about using phpmyadmin to set up a MySQL database for the WordPress install, it did not mention at that point that the default username and password for phpmyadmin would be root and blank. I had to enter that information to be able to create the database for WordPress. The post did mention it later when talking about setting up the wp-config.php file.

When I reached the point where the WordPress application displayed a screen prompting me to create a configuration file, I went ahead and clicked on the “Create A Configuration File” button. The next screen appeared as shown in the post. I entered the information for the database name, username and password, and entered “localhost” for the database host. However, when I clicked the Submit button, the browser appeared to not be able to connect to the server. As I mentioned in an earlier post, I had to use “http://localhost:8080” for my WampServer install. I then entered localhost:8080 as the host name, but this was not successful, either. I finally decided to go ahead and create a configuration file by saving a copy of wp-config-sample.php as wp-config.php in the root directory of my WordPress directory (C:\wamp\www\mytestweblog for my install). Here are my entries:

[cc lang=”perl”]

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘mytestwp_db’);

/** MySQL database username */
define(‘DB_USER’, ‘root’);

/** MySQL database password */
define(‘DB_PASSWORD’, ”);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

[/cc]

After creating that file, I again went to http://localhost:8080/mytestweblog/, and was able to resume setup of my weblog per the post. I played around with the test weblog, and liked it enough to put it on my main weblog.

For WampServer installs where port 8080 has to be used, it seems that WordPress has problems with creating a configuration file. The user will probably need to create the file manually.

 

Correcting WAMPServer Apache problems

A long time ago, I had the WAMPServer application set up on a netbook and did some WordPress work on that setup. Since then, I have moved on to a full laptop, but had not used WAMPServer on that machine. I wanted a place to explore some different WordPress themes separate from my regular install, so I started on the WAMP install process.

I downloaded the current version at the time and clicked through the install steps, which were pretty straightforward. However, when I started WAMPServer and tried to enter “localhost” in the browser, I did not see the default PHP index page. After some searching in the WAMPServer forums, I found that if Skype is installed, that can tie up port 80. I tried unchecking the box for port 80 in Skype options in my installation, but still did not see anything when I entered localhost in the browser. Finally, per this Wampserver forum post, I saw that it should be possible to change the Apache port to port 8080 instead of 80. I edited httpd.conf (at C:\wamp\bin\apache\Apache2.4.4\conf in my install) and changed the port listening to 8080 as follows:

[cc lang=”perl”]
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8080
[/cc]

After that, http://localhost:8080 worked! The WAMPServer documentation should be updated to make it easier to correct this problem.