Mac安装PHP7

2017-03-16  本文已影响0人  欧巴刚弄死他

首先我们需要安装Homebrew。注意它会让你通过回车键确认,并验证你的密码。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

通过brew来安装:

 $ brew install homebrew/php/php56-redis

重启Apache

sudo apachectl restart

到你的Apache的默认目录/Library/WebServer/Documents下面去增加一个info.php的文件。

<?php    
 phpinfo();    
 ?>

你的php7.0目录会在"/usr/local/opt/php70/bin"
这个地址可以用来粘贴在PhpStorm的CLI Interpreter中(Preference->Language&Frameworks->PHP->CLI Interpreter->...->PHP executable)。

上一篇下一篇

猜你喜欢

热点阅读