php-interbase

  • 首先安装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!

参考:

  1. http://www.php.net/manual/en/ibase.installation.php
  2. https://github.com/Tomas2D/Compile-Interbase-PHP-MAC-OS-X-10-12
  3. http://www.cnblogs.com/phpgo/p/5683356.html

你可能感兴趣的:(php-interbase)