<code>5.6.27 (brew安装的版本) </code>
<code>5.6.24 </code>
<code>export PATH="/usr/local/bin:/usr/local/sbin:$PATH"</code>
This has been added to ~/.bashrc
So I don’t understand why
<code>5.6.27 (brew安装的版本) </code>
<code>5.6.24 </code>
<code>export PATH="/usr/local/bin:/usr/local/sbin:$PATH"</code>
This has been added to ~/.bashrc
So I don’t understand why
The path
of php
that comes with your Mac
, before the path
you set, the previously matched php
will be used first.
First which php
, find the path that comes with php
, and then rename it. For example mv xxx/php xxx/php5.6.27
.
However, I am not sure whether deleting the built-in php or mv will cause problems for other applications, so it is recommended not to delete it directly, at least keep a backup.
<code>sudo ln -sf [php5.6.27目录]/bin/php /usr/bin/php sudo ln -sf [php5.6.27目录]/bin/pecl /usr/bin/pecl sudo ln -sf [php5.6.27目录]/bin/phpize /usr/bin/phpize sudo ln -sf [php5.6.27目录]/bin/pear /usr/bin/pear #重启php-fpm, 非fpm模式重启apache #或者干脆重启mac sudo reboot</code>