This is how you can setup named virtual hosts on MAMP. First open up the
httpd.conf file like this:
Add this to the bottom of the file. Requests to a
localhost request would go to one virtual host. Requests to any host with a
*.local extension go to the other virtual host.
NameVirtualHost * <VirtualHost *> DocumentRoot "/Applications/MAMP/htdocs" ServerName localhost ServerAlias localhost </VirtualHost> <VirtualHost *> DocumentRoot "/Applications/MAMP/htdocs/something/else" ServerName *.local ServerAlias *.local </VirtualHost>
DYLD_LIBRARY_PATH issues connected to MAMP and ImageMagick.
Sometimes binaries compiled with dynamic library requirements choke when being called via
shell_exec() in MAMP. I first noticed this when having issues with ImageMagick
convert being called via the
exec() with errors showing up via
stderr instead of the standard PHP error log; massive pain in the ass:
tail -f -n 200 /var/log/system.log
This is due to MAMP setting a
DYLD_LIBRARY_PATH environment variable. Unsure what is lost by disabling this, but I was able to fix ImageMagick interaction with MAMP by neutering it like this.
First open up the MAMP specific,
envvars file like this:
Then find the line near the bottom that reads like this:
And comment it out like this:
Finally restart the MAMP servers and all should be good as far as
exec() and programs that require dynamic libraries like ImageMagick.
Adjusting the PHP timezone.
Since MAMP is developed in Germany, the default time zone is set to
Europe/Berlin. To make things easier when debugging things if you are not in Germany is to adjust the timezone like this. First, open up the MAMP specific
php.ini file like this:
Find this chunk of configuration code:
; Defines the default timezone used by the date functions ; Will be changed by MAMP to system timezone date.timezone = "Europe/Berlin"
Then adjust it like this; which in this case switches the timezone to
; Defines the default timezone used by the date functions ; Will be changed by MAMP to system timezone ; date.timezone = "Europe/Berlin" date.timezone = "America/New_York"
With that done, save the file, restart MAMP and the timezone for things like PHP error logs will now be properly set to the