Once the source appears, the command does not exist, but when executing which php, the path of that php is changed to the correct path
/Applications/MAMP/bin/php/php7.1.1/bin/php[! But at the end there is the bold PHP on the left! ]
But every time I reopen the terminal, which php is reset to /usr/bin/php
The following is the command diagram of .bash_profile
The command is written wrong, there is no
≈
in≈source
, it should be a separatesource
.The shell you are using now is zsh, but the file you modify is the Bash configuration file, so zsh will not load the bash configuration file. Either modify the zsh configuration file or change the default shell to bash.
There are many shells on Unix (Macos is a Unix-like system) or Linux system, including zsh, bash, sh, ksh, csh, sh and other shells. They are all shells, but they are still different.