时间:2021-07-01 10:21:17 帮助过:4人阅读
brew options php56 && brew install php56
echo 'export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
brew install php56-xdebug php56-mcrypt php56-imagick
sudo apachectl restart
打开浏览器,进入http://localhost/phpinfo.php
, 发现依然无法替代yosemite自带的PHP 5.5.14
我的安装方法(主要参考了:http://www.cnblogs.com/xiangmin/p/4279627.html)
brew options php56 && brew install php56
echo 'export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
brew install php56-xdebug php56-mcrypt php56-imagick
sudo apachectl restart
打开浏览器,进入http://localhost/phpinfo.php
, 发现依然无法替代yosemite自带的PHP 5.5.14
修改apache的配置httpd.conf,将LoadModule php5_module libexec/apache2/libphp5.so修改成泥新生成的so,比如:LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so。然后重启apache