MAMP on Windows 10 for a local development
When choosing a local development servers to setup, it is surprising how many people assume MAMP is only for MacOS users and the alternative for Windows is WAMP. I guess the M in MAMP can be misleading as the M stands for Mac (Apache, MySQL and PHP). However, MAMP have been releasing a Windows version as far back as near the end of 2015.
Installing MAMP is pretty straightforward. You can follow the documentation here: https://documentation.mamp.info/en/MAMP-PRO-Windows/Installation/New-Install/
MAMP is well documented so it's easy to get started.
Both free and paid versions works out of the box and most web applications such as Drupal or WordPress will work fine.
But it's really the paid version that shines as it comes with an UI to configure all the settings on the server so you don't need to fiddle about with updating files to make any changes to servers.
If you need Composer, it is easy to install: see: https://documentation.mamp.info/en/MAMP-PRO-Windows/How-Tos/General/SetupComposer/
Make sure you select the latest PHP version if you are planning on using Composer with Drupal 8 or 9.
You don't need to install Drush Commandline Tool globally, you can install it per installation so you run it on a per project basis. To do this, you need Composer and run the following command:
composer require drush/drush
Once installed, inside your Drupal installation, to run drush you need to provide the path to Drush, which is:
vendor/drush/drush/drush
If you do plan on using just the free version and want to manage your vhost, make sure vhost is enabled in Apache server. There are 2 things you need to alter.
Open up C:\MAMP\conf\apache\httpd.conf in a text editor and go to line 216 and change:
AllowOverride none
to
AllowOverride all
So the whole line should read as:
<Directory />
Options FollowSymLinks ExecCGI
AllowOverride all
Order deny, allow
Allow from all
</Directory>
next search for: #Virtual hosts
and uncomment
Includes conf/extras/httpd-vhosts.conf
If i was to use either MAMP or WAMP for Windows, i think i would choose WAMP simply because it's free and provides a numerous ways to configure your servers via UI. But if i'm. willing to pay for MAMP then i think it would have been a better choice because the UI is more intuitive.
After that, you can add the virtual host path
Open C:\MAMP\conf\apache\extra\httpd-vhost.conf in a text editor (like Notepad or better - Notepad ++)
add the virtual host with server name and document root like the below code:
<VirtualHost *:80>
ServerName example.dev
DocumentRoot "/path/to/directory"
</VirtualHost>
Allow your computer to recognise your local domain
Open up C:\Windows\system32\drivers\etc\hosts in a text editor (like Notepad or better - Notepad ++)
then add your domain:
127.0.0.1 example.dev
Restart your server.
Of course, if this gets tedious, then you can consider purchasing the paid version so you do everything through the MAMP application UI.
This is what the UI looks like: