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

Jonjie's avatar
Level 12

How to switch php versions on mac catalina?

I'm trying to switch project between laravel 8 and laravel 5.2 but unfortunately laravel 5.2 only runs on php5.5.9 - php7.1 and I'm currently running PHP7.4, so I ended up following this thread https://stackoverflow.com/questions/34909101/how-can-i-easily-switch-between-php-versions-on-mac-osx, but nothings works for me.

And then I'm trying this one: https://medium.com/@jalendport/how-to-switch-between-php-versions-on-your-mac-b561758ed8f5, But when I run php -v, I'm getting this error:

dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib

So I tried to find answers about this here: https://stackoverflow.com/questions/59006602/dyld-library-not-loaded-usr-local-opt-openssl-lib-libssl-1-0-0-dylib, but nothing works. Do you have any other options so I can switch between my projects?

0 likes
4 replies
siangboon's avatar

there can only have one version running at your environment at a time but you can have multiple version sit in your system and use it, by executing php with specifying the actual full path of the php

for example, my system running php 7.4, whenever i want to have php 5.6 i will just run c:\php\php56\php instead of just php... I'm using Windows but i believe it work the same way in other platform as well...

you also can setup multiple virtual hosts in your apache or web server with different php version...

Jonjie's avatar
Level 12

@siangboon Thanks, yup it's also good working on windows for me but currently I'm using macOS (catalina).

Jonjie's avatar
Level 12

@siangboon Already done the 2nd link. The first link is what Im currently doing but still getting the same error

Please or to participate in this conversation.