When you have to set up a development environment quickly on a Windows machine WAMP is a good option as installing and configuring it is a breeze. Let’s have a look at how to establish a multiple-project structure in WampServer 3.
1. Download WAMP onto your machine.
Download WampServer and follow the instructions provided on wampserver.com for installation.
In this article we are working with WAMP 3 - WAMPSERVER (64 BITS & PHP 5.6 & PHP 7) 3.
As of 01.08.2016, the package includes:
64 bit WampServer 3.0.4:
- Apache 2.4.18
- PHP 5.6.19/7.0.4
- MySQL 5.7.11
Operating system: Windows 10
System type: 64-bit
By default it creates a ‘wamp64’ directory in your Windows root:
2. Setting up multiple projects in WampServer 3.
The root folder is 'www’ inside the ‘wamp64’ directory (C:\wamp64\www). This is where you can set up multiple directories for your projects. These directories inside ‘www’ are going to be your project root directories. Let’s name our test directory ‘mydirectory’.
3. Assign aliases to your projects.
Make sure Wamp3 is running.
Open up the WAMP popup menu by left clicking on the WAMP icon in your systems tray in the bottom-right corner and navigate to ‘Apache’ > ‘Alias directories’, and click on ‘Add alias’.
A command prompt window will open up:
Specify the alias that you would like to use without any single quotes and press 'Enter'. (This will be between the last two slashes of your new local URL: 'http://localhost/mydemodomain/'.
Enter the destination path as an absolute path to your project root directory such as 'c:/wamp64/www/mydirectory/' and hit 'Enter'. WAMP will confirm that your alias has been created.
Hit 'Enter' again to close the window. WAMP will restart itself.
You should see the WAMP icon changing colours. When it is back to green again, you are good to go.
You should see your new alias in the list under the ‘Alias directories’ menu item in WAMP’s popup navigation.
Use your new URL in your chosen browser, 'http://localhost/mydemodomain/', and visit your site that you have just set up locally. You can also click on ‘Localhost’ in the top of WAMP’s popup navigation that takes you to a dashboard and all your aliases will be listed under ‘Your aliases’ in this page with clickable links that will take you to the URLs you specify.
When ERRORs happen
If you haven’t created the directory yet, or you have misspelled something in the path, it will complain and let you know that the alias hasn’t been created.
- ! TIP ! -
If you can’t access your new site, check if you have at least the default ‘index.php’ that comes with WAMP copied into your project root; or you might want to check the permissions assigned to the files and folders in your project root. Windows can get playful with those!
How to delete an alias
Open up the WAMP popup menu by left clicking on the WAMP icon in your systems tray in the bottom-right corner, and navigate to ‘Apache’ > ‘Alias directories’ > alias in question. Click on the little triangle on the right to access the list of actions you are offered to execute on the alias by WAMP. You have the options of editing the alias, editing the '.htaccess' file, and suppressing the alias.
To delete the alias, click on ‘Suppress alias’.
A command prompt window will open up and ask you if you are sure. Type the word ‘yes’ to delete the alias.
It will celebrate with a confirmation of the alias being deleted. Hit ‘Enter’ to close the window.
How to export MySQL database into a ‘.sql’ file on WAMP
MySQL dump in Windows command prompt
If you are used to Linux/Unix based environments using the command line...
My often used MySQL commands
Basic MySQL commands
Basic commands for managing databases in MySQL on the command-line in local...
‘mysqldump Version Mismatch’ warning from MySQL Workbench
Changing the path to mysqldump program file
How to make sure that the mysqldump.exe version of MySQL Workbench is equal...