0

I have now tried everything imaginable.

The following problem occurs:

In the terminal PHP runs in version PHP 7.4.12 from MAMP.

php -v output:

PHP 7.4.12 (cli) (built: Nov 30 2020 13:28:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

When I output the path with which php I get this output:

 ❯ which php
 /Applications/MAMP/bin/php/php7.4.12/bin/php

If I now in my CakePHP project in the cake.php php phpinfo(); me using cake/Console/cake.php output, I get the PHP

phpinfo()
PHP version => 7.3.24-(to be removed in future macOS) 

I have as far as possible the php version for the CLI modified. This in all imaginable files. In ~/.zshrc the path is: export PATH=/Applications/MAMP/bin/php/php7.4.12/bin:$PATH. Which was also confirmed with which php.

My System:

  • MacOS Big Sur Version 11.2.3
  • MAMP Pro Version 6.3
  • CakePHP 2.10.24
halfer
  • 19,824
  • 17
  • 99
  • 186
jefiedler
  • 21
  • 2

1 Answers1

0

I found a solution on stackoverflow after all. Note that this is only an excerpt from another answer. Which I also link here. The post I found with a similar problem gives the following solution:

  1. run the following:
export PHP_VERSION=`grep "alias php" ~/.profile | cut -d"/" -f6 | cut -c4-`
  1. add the following to ~/.zshrc on top of it:
export PHP_VERSION=`grep "alias php" ~/.profile | cut -d"/" -f6 | cut -c4-`
export PHPRC="/Library/Application Support/appsolute/MAMP PRO/conf/" #point to your php.ini folder to use the same php settings
export PATH=/Applications/MAMP/bin/php/php$PHP_VERSION/bin:$PATH

Here is the original post: How to override the path of PHP to use the MAMP path?

jefiedler
  • 21
  • 2