温斯顿吴的个人博客 woojean.com

更新Mac的PHP及各种扩展为最新

2017-04-05

所有程序、扩展全部用最新稳定版本!(所有扩展需要使用PHP7环境进行编译)

Mac

先安装PHP7,否则phpize无法编译cphalcon

brew update
brew tap homebrew/dupes
brew tap homebrew/php
brew update
brew unlink php56   # 删除低版本php
brew install php71

测试:

wujian@wujiandeMacBook-Pro 64bits$ php -v
PHP 7.1.3 (cli) (built: Mar 28 2017 21:57:28) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

安装Phalcon.so

https://github.com/phalcon/cphalcon/archive/v3.1.1.tar.gz

cd /Users/wujian/extensions/cphalcon-3.1.1/build/php7/64bits
sudo phpize
sudo ./configure
sudo make & make install

# 拷贝生成的模块
cp /Users/wujian/extensions/cphalcon-3.1.1/build/php7/64bits/modules/phalcon.so /Users/wujian/extensions/phalcon.so

更新seaslog.so

https://github.com/Neeke/SeasLog/archive/SeasLog-1.6.9.tar.gz

cd /Users/wujian/extensions/SeasLog-SeasLog-1.6.9
sudo phpize
sudo ./configure
sudo make & make install # 如果失败 make clean后再sudo make

# 拷贝生成的模块
cp /Users/wujian/extensions/SeasLog-SeasLog-1.6.9/modules/seaslog.so /Users/wujian/extensions/seaslog.so

更新redis.so

https://github.com/phpredis/phpredis/archive/3.1.2.tar.gz

cd /Users/wujian/extensions/phpredis-3.1.2
sudo phpize
sudo ./configure
sudo make & make install  # 如果失败 make clean后再sudo make

# 拷贝生成的模块
cp /Users/wujian/extensions/phpredis-3.1.2/modules/redis.so /Users/wujian/extensions/redis.so

更新xdebug

https://github.com/xdebug/xdebug/archive/XDEBUG_2_5_1.tar.gz

cd /Users/wujian/extensions/xdebug-XDEBUG_2_5_1
sudo phpize
sudo ./configure
sudo make & make install 

# 拷贝生成的模块
cp /Users/wujian/extensions/xdebug-XDEBUG_2_5_1/modules/xdebug.so /Users/wujian/extensions/xdebug.so

更新swoole.so

https://github.com/swoole/swoole-src/archive/v2.0.7.tar.gz

cd /Users/wujian/extensions/swoole-src-2.0.7
sudo phpize
sudo ./configure
sudo make & make install 

# 拷贝生成的模块
cp /Users/wujian/extensions/swoole-src-2.0.7/modules/swoole.so /Users/wujian/extensions/swoole.so

更新thrift_protocol.so

https://github.com/apache/thrift/archive/0.10.0.tar.gz

cd /Users/wujian/extensions/thrift-0.10.0/lib/php/src/ext/thrift_protocol

sudo phpize
sudo ./configure
sudo make & make install 

cp /Users/wujian/extensions/thrift-0.10.0/lib/php/src/ext/thrift_protocol/modules/thrift_protocol.so /Users/wujian/extensions/thrift_protocol.so

编辑MAMP的PHP7配置文件(php7.1.1.ini):

extension=/Users/wujian/extensions/phalcon.so
extension=/Users/wujian/extensions/seaslog.so
extension=/Users/wujian/extensions/redis.so
extension=/Users/wujian/extensions/swoole.so
extension=/Users/wujian/extensions/thrift_protocol.so
zend_extension=/Users/wujian/extensions/xdebug.so

文章目录