I need to update my PATH variable within a MAMP v3.4 server.
As you can see, the PATH environment variable that Apache is using does not match the PATH that I use when I open terminal.
<?php
passthru('env');
die();
The script above prints out:
...
PATH=/usr/bin:/bin:/usr/sbin:/sbin
...
Meanwhile, my PATH when I run my terminal is:
$ env
...
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I have tried the solutions offered here and here, but none have worked.
Setting an environment variable in /Applications/MAMP/conf/apache/httpd.conf
seemed promising, but it doesn't work when setting PATH.
# Near the top of my httpd.conf file...
SetEnv MY_TEST_DETAIL foo
SetEnv PATH /usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I restart my MAMP server, and looked at phpinfo()
As you can see, it added the MY_TEST_DETAIL environment variable, but it did not change PATH.