Mac OS X brew安装php7

Mac OS X brew 安装 php7

因为php7的二进制包放在 cloudfront.net 上,这个网站被我大功夫网墙了,直接 brew install 安装不了,所以爬墙可以手动下载

1.下载 wget https://homebrew.bintray.com/bottles-php/php70-7.0.0.el_capitan.bottle.8.tar.gz

2.拷贝到 brew 缓存目录
    cp php70-7.0.0.el_capitan.bottle.8.tar.gz /Library/Caches/Homebrew/

3.brew install php70

4.修改apache配置文件:sudo vim /etc/apache2/http.conf

注释掉Mac系统自带的 php5
# LoadModule php5_module libexec/apache2/libphp5.so

添加几行启用php
LoadModule php7_module    /usr/local/opt/php70/libexec/apache2/libphp7.so

<FilesMatch .php$>
    SetHandler application/x-httpd-php
</FilesMatch>

5.重启apache2  
    sudo apachectl restart

你可能感兴趣的:(Mac OS X brew安装php7)