- 首先安装Firebird,官网下个pkg装一下就好了。
- 然后创建Firebird链接,为后面编译interbase.so做准备。
cd /usr
sudo mkdir -p local/firebird/lib
sudo ln -s /Library/Frameworks/Firebird.framework/Firebird local/firebird/lib/libfbclient.dylib
sudo ln -s /Library/Frameworks/Firebird.framework/Headers/ local/firebird/include
Download PHP source code from https://secure.php.net/downloads.php
下载对应MAMP版本的PHP源码Unzip downloaded sources, rename it to "php" and move it to your MAMP include folder /Applications/MAMP/bin/php/php7.1.6/
解压到/Applications/MAMP/bin/php/php7.1.6/,这个7.1.6
替换你下载的MAMP配套版本。如果没有安装过
autoconf
,先brew install autoconf
创建
interbase.so
cd /path-to-php-source/ext/interbase
/Applications/MAMP/bin/php/php7.1.6/bin/phpize
./configure --with-interbase=/usr/local/firebird
make
- 剩下的就不翻译了,见如下引用
#install so to mamp-ext.dir
cp modules/interbase.so \
/Applications/MAMP/bin/php5/lib/ \
php/extensions/no-debug-non-zts-20050922
#add to /Applications/MAMP/conf/php5/php.ini
[firebird]
extension = interbase.so
ibase.allow_persistent = "1"
ibase.max_persistent = "-1"
ibase.max_links = "-1"
ibase.default_db = null
ibase.default_user = NULL
ibase.default_password = NULL
ibase.default_charset = NULL
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
#restart mamp - interbase should show in phpinfo
#enjoy!
参考: