Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sanjayacloud's avatar

How to manage multiple php version in Mac with MAMP like Laragon

Hay everyone,

Can I know How to manage multiple php version in Mac with MAMP like Laragon? I am asking without changing path variable for PHP when we working on different laravel versions.

0 likes
10 replies
LaryAI's avatar
Level 58

You can manage multiple PHP versions in Mac with MAMP by using the MAMP Pro version. MAMP Pro allows you to switch between different versions of PHP and Apache. To switch between versions, open MAMP Pro and go to the “Hosts” tab. Select the host you want to change the PHP version for and click the “PHP” tab. From there, you can select the version of PHP you want to use.

If you don't have MAMP Pro, you can still switch between different versions of PHP by changing the path variable. To do this, open the terminal and type the following command:

export PATH=/Applications/MAMP/bin/php/<php-version>/bin:$PATH

Replace with the version of PHP you want to use. For example, if you want to use PHP 7.2, the command would be:

export PATH=/Applications/MAMP/bin/php/php7.2.10/bin:$PATH

Once you have set the path variable, you can check the version of PHP you are using by typing the following command in the terminal:

php -v
sanjayacloud's avatar

@LaryAI I use MAMP Pro. And I select php version that I want to use. But when I going to do composer install or something, Its get the general php version that available in path variable. That's thing I want to figure out.

webrobert's avatar

Idk about Laragon but I’m pretty happy with containers via lando

happy to have made the change from MAMP

webrobert's avatar

There are few people here that use it. @sinnbeck is maybe the most versed. Personally I got tired of not being able to run old projects. or ones that were different versions. "dont update because da da da..." Lando solved that. Containers. Also there is a Laracon talk on it. US Laracon... a few back, not sure which one off hand.

sanjayacloud's avatar

@webrobert Yah. I also don't like it. But this is my workplace environment. I have to follow that thing.

Please or to participate in this conversation.