The php command being built and run by Craft will be run inside a specific shell environment, and at that point is unlikely to find the php provided by Indigo. It's a very similar issue to this one, I believe.
The fix described on that issue looks good, although I take strong exception to the following:
If you're using mamp or any other awkward environment where php isn't in the system path; this would likely work for you too.
Perhaps by awkward he meant clever ๐คฃ
Anyway, that random diversion aside (haha), here's the suggestion from that post that I hope may work for you:
I added a PATH="/opt/rh/rh-php73/root/usr/bin:/opt/rh/rh-mysql56/root/usr/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin" to the top of my sites .env file. (usually in the SITEROOT/craft/ folder) and now updates succeed and database backups work too.
To achieve this in your case, you'd need to do the following:
1) In the terminal, run your indigo.set.your-stack-name
command to set up PHP etc for that terminal session.
2) now you can run which php
to get the path to your Indigo PHP. This should output something like: /Users/username/.indigo/stacks/5949E1/php_ACDA/bin/php
. Copy this for later, without the final /php
.
3) do the same for MySQL: which mysql
should output something like /Users/username/.indigo/stacks/5949E1/mysql_8AA8/bin/mysql
. Copy this for later, without the final /mysql
.
4) find your Craft site's .env
file. It should be in your Craft site's root (press cmd
+shift
+.
to see hidden files in the Finder if needed)
5) modify the following as needed using the above two outputs, and put it at the top of your .env
file:
PATH="/Users/username/.indigo/stacks/5949E1/php_ACDA/bin:/Users/username/.indigo/stacks/5949E1/mysql_8AA8/bin"
The final :/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
mentioned in the stackexchange post is not correct for a mac (at least not an Apple Silicon mac), but if Craft exhibits other issues after you add the new PATH line, let me know and we can work out what should go there (or Craft support may be a better source for that info).
Phew, that's long! Let me know how you go! Thanks for persevering ๐