I upgraded my OS to Monterey and meanwhile I installed multiple versions using brew. Basically I followed this post: https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions
I am not getting any error while I do switch but in the end php-v shows my default php version which is 5.6 Also I have tried to do switch without phpSwitcher script:
brew unlink php@5.6 && brew link --overwrite --force php@7.4
but without any success. Trace of running script:
sphp 8.1
Switching to php@8.1
Switching your shell
Unlinking /usr/local/Cellar/php@5.6/5.6.40_4... 25 symlinks removed.
Unlinking /usr/local/Cellar/php@7.4/7.4.28... 0 symlinks removed.
Unlinking /usr/local/Cellar/php@8.0/8.0.16... 0 symlinks removed.
Unlinking /usr/local/Cellar/php/8.1.3... 0 symlinks removed.
Linking /usr/local/Cellar/php/8.1.3... 24 symlinks created.
Switching your apache conf
Restarting apache
Stopping `httpd`... (might take a while)
==> Successfully stopped `httpd` (label: homebrew.mxcl.httpd)
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
PHP 5.6.40 (cli) (built: Jan 20 2022 03:46:40)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
All done!
My httpd.conf:
LoadModule php5_module /usr/local/opt/php@5.6/lib/httpd/modules/libphp5.so
#LoadModule php7_module /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so
#LoadModule php_module /usr/local/opt/php@8.0/lib/httpd/modules/libphp.so
#LoadModule php_module /usr/local/opt/php@8.1/lib/httpd/modules/libphp.so
Does anyone have idea what is preventing version to be changed?
Thanks in advance.