Please click here if you are not redirected within a few seconds.
WAMP Notes › shanebow.com
WAMP Notes

A WAMP server (in the general sense) is a web server consisting of Apache, MySQL, and PHP (the AMP part) running on Windows (the "W" part). You can download these programs yourself and you will have yourself a WAMP stack.

However, it is time consuming and error prone - This, I know first hand!

So, Romain Bourdon to the rescue: He created WAMPServer which bundles the AMP stack along a few utility apps in a prefigured package that basically works right out of the box.

Well actually, it has never worked right out of the box for me - I really wish they would automatically install the necessary Visual C++ redistributables - but nonetheless it's much easier than doing it yourself from scratch.

Here are some suggestions for making it a really slick program.

Move the www Directory

As a developer I hate mixing code with data — and by extension I hate mixing data with program files.

So, it is important to me that my web site root directory be outside of WAMP, not inside of it. So how to do it? You would think it would be easily configurable, but it's not!

You need to change the $wwwDir variable in path/to/wamp/scripts/config.inc.php.

Note that, the default localhost virtual host in the Apache httpd-vhosts.conf should still point to the "internal" www dir:

<VirtualHost 127.0.0.1>
     DocumentRoot "C:/path/to/wamp/www"
     ServerName localhost
     ServerAlias www.localhost
     <Directory  "C:/path/to/wamp/www">
        AllowOverride All
        Require local
     </Directory>
 </VirtualHost>

This is because that virtual host contains tools/code that are hard coded to point to PHP code in the '../scripts' directory. These scripts automate tasks such as creating a new virtual host.

Add multiple versions of PHP

One of the very cool things about WAMPServer is that it supports easy switching between multiple versions of PHP, MySQL, and Apache. I have never found it useful as a developer to switch the latter two, but the ability to switch PHP is wonderful especially when testing things like WordPress updates or PHP frameworks (e.g. Laravel, CodeIgniter).

Customize the menu

But the real genius of WAMPServer is the little tray menu interface that ties all the pieces together: It is actually a separate program called Aestan Tray Menu which has been released into the Public Domain.

The really cool thing about Aestan Tray Menu, is that it's completely configurable! Just edit the wampmanager.tpl file located in the root of your WAMPServer installation. It's fairly easy to figure out what's going on: The "big aha" for me was realizing that the "left" and "right" sections were for left and right mouse clicks!

I went into a customizing frenzy in which I reorganized, and added links. For instance, to launch the windows hosts file inNotepad, add this line:

Type: item; Caption: "Windows hosts file"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters:"C:/Windows/System32/drivers/etc/hosts"

How to launch a java app from the WAMP server tray icon

But I ran into problems when I tried to add links to launch some of my custom tools written in java and packaged in executable jar files. Key is the working directory parameter:

Type: item; Caption: "SiteBuilder"; Action: shellexecute; FileName: "C:/apps/usr/shanebow/tools/Sitebuilder.jar"; WorkingDir: "C:/apps/usr/shanebow/tools/"; Glyph: 6

The Aestan homepage doesn't seem to contain the documentation above does not Find the docs on Github

Now do, Right click the WAMPServer icon to reveal the menu-> Apache -> Service -> Test port 80 This will launch a command window and display some information about what, if anything is using port 80.

Whatever it is should be re-configured to not use port 80 or uninstalled if you are not using it.

If port 80 is not the problem look for errors in the appropriate error log ( use the wamp manager menus to view the error logs )

If these do not exists or show no errors then also check the Windows Event Viewer Start -> Administrative Tools -> Event Viewer And look in the 'Windows Logs' -> Application' section accessed from the menu on the left of the dialog for error messages from Apache and or MySQL.

How to Configure SKYPE so it does not require port 80 or 443

Run SKYPE then using the menus do this: Tools -> Options -> Advanced -> Connection Un-Check the checkbox next to 'Use port 80 and 443 as alternatives for incomming connections' Now restart SKYPE for these changes to take effect.

If you are running Windows 8 SKYPE comes as an app and this cannot ( as yet ) be configured in this way. However if you uninstall the SKYPE app and install SKYPE in the old way, you can reconfigure it, and it works just as well.

Launch As Service

Follow these instructions to start the appropriate WAMP services on start-up. UAC will not interfere here and there is no need to log in to start your web-server:

Add a site (vhost), xyz.local

  • Open notepad as administrator in order to add the following line to C:\Windows\System32\drivers\etc\hosts
    127.0.0.1 xyz.local
  • Edit /bin/wamp32bin/apache/apache2.4.46/conf/extra/vhosts.conf

Some gotchas

  • Skype may have hijacked port 80 - use the TEST PORT 80 utility
  • can also talk about: http://stackoverflow.com/questions/1451468/intl-extension-installing-php-intl-dll

Which service is causing orange icon?

  • Left click the wampmanager icon to reveal the menu-> Apache -> Service If the Start/Resume service menu is Green then Apache IS NOT running.
  • Left click the wampmanager icon to reveal the menu-> MySQL -> Service If the Start/Resume service menu is Green then MySQL IS NOT running.
  • If Apache is the service that is not running it is normally, but not always, because something else has captured port 80.

My edits

  • /wamp/scripts/config.inc.php set $wwwDir = 'd:/www';
  • /wamp/bin/apache/apache2.4.46/conf/extra/httpd-vhosts.conf
  • /wamp/bin/mysql/mysql5.7.31/my.ini set datadir