Skip to content

Instantly share code, notes, and snippets.

@devLopez
Last active December 26, 2019 18:28
Show Gist options
  • Save devLopez/c5b773e8546faa99915c09e257a8b040 to your computer and use it in GitHub Desktop.
Save devLopez/c5b773e8546faa99915c09e257a8b040 to your computer and use it in GitHub Desktop.

Compiling Interbase/Firebird extension for PHP 5.6.10 under MAC OS X

Short tutorial on how to compile Firebird extension for PHP under MAC OS X El Capitan 10.11

Before compiling PHP extension you must have Autoconf, you can install it via Homebrew (brew install autoconf) Because we needs Firebird libs. for compiling interbase, we have to download Firebird Server Package (http://www.firebirdsql.org/en/downloads), download the LIPO package (important!)

Let's compile! (MAMP 3.4.0 ... PHP 5.6.10)

  • Check which PHP version your MAMP server use, for example version 3.4.0 use PHP 5.6.10 by default
  • Download PHP source code from https://secure.php.net/downloads.php
  • Unzip downloaded sources, rename it to "php" and move it to your MAMP include folder /Applications/MAMP/bin/php/php5.6.10/
  • Enter to interbase extension folder cd /Applications/MAMP/bin/php/php5.6.10/include/php/ext/interbase/
  • Run phpize /Applications/MAMP/bin/php/php5.6.10/bin/phpize
  • Run configure ./configure
  • Create symbolic link to Firebird ibase.h and iberror.h in our include/php folder so ln -s /Library/Frameworks/Firebird.framework/Headers/*.h /Applications/MAMP/bin/php/php5.6.10/include/ these two header files are required
  • Run make
  • Run sudo make install

You should get your interbase.so ! Wooah

Let's compile! (MAMP 4.1.1 ... PHP 7.1.1)

  • Check which PHP version your MAMP server use, for example version 4.1.1 use PHP 7.1.1
  • Download PHP source code from https://secure.php.net/downloads.php
  • Unzip downloaded sources, rename it to "php" and move it to your MAMP include folder /Applications/MAMP/bin/php/php7.1.1/
  • Enter to interbase extension folder cd /Applications/MAMP/bin/php/php7.1.1/include/php/ext/interbase/
  • Run phpize /Applications/MAMP/bin/php/php7.1.1/bin/phpize
  • Run configure ./configure --with-php-config=/Applications/MAMP/bin/php/php7.1.1/bin/php-config
  • Create symbolic link to Firebird ibase.h and iberror.h in our include/php folder so ln -s /Library/Frameworks/Firebird.framework/Headers/.h /Applications/MAMP/bin/php/php7.1.1/include/ ln -s /Library/Frameworks/Firebird.framework/Headers/.h /Applications/MAMP/bin/php/php7.1.1/include/php/ext/interbase/include/ these two header files are required
  • Run make (for someone maybe make -j8)
  • Run make install

You should get your interbase.so (/Applications/MAMP/bin/php/php7.1.1/include/php/ext/interbase/modules/interbase.so) ! Wooah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment