This page descibes how to set up a Mac to be a local development host server
MAMP is a free, local server environment that can be installed under macOS (and Windows) with just a few clicks.
There is a pro version but it is not necessary to setup a working dev environment.
The installation is pretty straightforward using MAMP documentation
Using several PHP version
10.15.x and after
Osx now uses zsh instead of bash, .bash_profile won’t work anymore.
The new file name is ~/.zshrc
Make sure you have the following code in it:
Copy to clipboard
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
Make sure in MAMP PRO you have a box checked off under the PHP tab “Activate command line shortcuts...”
10.14.x and before
Osx uses .bash_profile to set the CLI version of PHP.
The file is located at ~/.bash_profile
Make sure you have the following code in it so your PHP CLI version will use the version accordingly to your MAMP PHP version selected:
Copy to clipboard
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
Make sure in MAMP PRO you have a box checked off under the PHP tab “Activate command line shortcuts...”
''This page descibes how to set up a Mac to be a local development host server''
[https://www.mamp.info/en/mac/|MAMP] is a free, local server environment that can be installed under macOS (and Windows) with just a few clicks.
There is a pro version but it is not necessary to setup a working dev environment.
The installation is pretty straightforward using [https://documentation.mamp.info/en/MAMP-Mac/|MAMP documentation]
! Using several PHP version
{TABS(name="mac_version_tabs" tabs="10.15.x and after|10.14.x and before")}
!!10.15.x and after
Osx now uses zsh instead of bash, .bash_profile won’t work anymore.
The new file name is ~/.zshrc
Make sure you have the following code in it:
{CODE()}
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
{CODE}
Make sure in MAMP PRO you have a box checked off under the PHP tab “Activate command line shortcuts...”
/////
!!10.14.x and before
Osx uses .bash_profile to set the CLI version of PHP.
The file is located at ~/.bash_profile
Make sure you have the following code in it so your PHP CLI version will use the version accordingly to your MAMP PHP version selected:
{CODE()}
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
{CODE}
Make sure in MAMP PRO you have a box checked off under the PHP tab “Activate command line shortcuts...”
{TABS}