Skip to content

Short tutorial on how to compile Interbase/Firebird extension under MAC OS for PHP 5, PHP 7

Notifications You must be signed in to change notification settings

Tomas2D/Compile-Interbase-PHP-MAC-OS-X-10-12

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 

Repository files navigation

Compiling Interbase/Firebird extension for PHP 5/7 under MAC OS X

Short tutorial on how to compile Firebird extension for PHP under MAC OS.

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!)

Update 2020-09-08

Interbase extension is currently not shipped with PHP source code. But below you will find way to achieve it.

Let's compile! (MAMP 5.7 ... PHP 7.4.2 )

@MartinKoeditz is working on driver for PHP>=7.1. The repo is here: https://github.com/FirebirdSQL/php-firebird. We cannot download final driver, one needs to compile it, here is how.

  1. git clone https://github.com/FirebirdSQL/php-firebird.git
  2. cd php-firebard
  3. /Applications/MAMP/bin/php/php7.4.2/bin/phpize
  4. CPPFLAGS="-I/usr/local/lib/Firebird.framework/Headers" ./configure
  5. make
  6. make install
  7. Open MAMP pro PHP 7.4.2 config file (.ini extension) and append new line: extension=interbase.so
  8. Restart MAMP server

Update 2020-03-30

The tutorial is still working, keep in mind that this tutorial is for Firebird 2.5.x only!

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

  1. Check which PHP version your MAMP server use, for example version 4.1.1 use PHP 7.1.1
  2. Download PHP source code from https://secure.php.net/downloads.php
  3. Unzip downloaded sources, rename it to "php" and move it to your MAMP include folder /Applications/MAMP/bin/php/php7.1.1/
  4. Enter to interbase extension folder cd /Applications/MAMP/bin/php/php7.1.1/include/php/ext/interbase/
  5. Run phpize with command /Applications/MAMP/bin/php/php7.1.1/bin/phpize
  6. Run configure ./configure --with-php-config=/Applications/MAMP/bin/php/php7.1.1/bin/php-config
  7. 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
  8. Run make (for someone maybe make -j8)
  9. Run make install

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

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

  1. Check which PHP version your MAMP server use, for example version 3.4.0 use PHP 5.6.10 by default
  2. Download PHP source code from https://secure.php.net/downloads.php
  3. Unzip downloaded sources, rename it to "php" and move it to your MAMP include folder /Applications/MAMP/bin/php/php5.6.10/
  4. Enter to interbase extension folder cd /Applications/MAMP/bin/php/php5.6.10/include/php/ext/interbase/
  5. Run phpize /Applications/MAMP/bin/php/php5.6.10/bin/phpize
  6. Run configure ./configure
  7. 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
  8. Run make
  9. Run sudo make install

You should get your interbase.so ! Wooah

ATTENTION FOR MAMP USERS (Mac OS)

Be sure that you are not running PHP in CGI mode (you will propably get 500 error code during connection to database) !

About

Short tutorial on how to compile Interbase/Firebird extension under MAC OS for PHP 5, PHP 7

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published