Mini HOWTO: Interbase/Firebird PHP extension on Zend Server CE for Mac OS X

A bit time ago I was desperately looking for running Firebird/Interbase PHP extension on Zend Server Community Edition for Mac OS X Snow Leopard, but googling around didn’t bring any helpful results. So, after a few hours spent, I managed to create one by myself. Here we go:

  1. If you have a previous version of Firebird installed, get rid of it with the following shell script (unless you actually use this installation!) – you need to become superuser first:
    echo "Clean Services"
    echo "Clean User"
    dscl localhost -delete /Local/Default/Users/firebird
    echo "Clean Group"
    dscl localhost -delete /Local/Default/Groups/firebird
    if [ -f "/Library/StartupItems/Firebird" ]; then
        echo "Remove SuperServer StartupItem"
        rm -fr /Library/StartupItems/Firebird
    if [ -f "/Library/LaunchDaemons/org.firebird.gds.plist" ]; then
        echo "Remove Launchd"
        launchctl unload /Library/LaunchDaemons/org.firebird.gds.plist
        rm /Library/LaunchDaemons/org.firebird.gds.plist
    echo "Remove Framework"
    rm -fr /Library/Frameworks/Firebird.framework
    echo "Remove Receipt"
    rm -fr /Library/Receipts/Firebird*.pkg
  2. Go to Firebird download site, grab a Intel x86 for MacOSX 10.4+, 32-bit Classic version package, compressed (2.1.3 was the current version at the time of writing). There’s no mistake here: 32-bit package is mandatory, because Zend Server CE builds are 32-bit!
  3. Unpack .zip and install Firebird RDBMS. Now, from Terminal, still as root:
    cd /Library/Frameworks/Firebird.framework/
    ln -s Libraries lib
    ln -s Headers include
  4. Grab and unpack PHP 5.3.2 Zend Server CE sources (to extract a .deb file you will need some smart program; I used BetterZip). Extract contents of the newly created data.tar.gz file and copy a php-source directory to a /usr/local/zend/share/.
  5. From Terminal:
    cd /usr/local/zend/share/php-source/php-5.3.2/ext/interbase
  6. Now we need to run some ugly, magic mumbo-jumbo from command line:
    ./configure --with-php-config=/usr/local/zend/bin/php-config --with-interbase=/Library/Frameworks/Firebird.framework MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -g -Os -pipe" CXXFLAGS="-arch i386 -g -Os -pipe" LDFLAGS="-arch i386 -bind_at_load"
    make install
  7. Restart Zend Server.

Done! Good luck 🙂

2 thoughts on “Mini HOWTO: Interbase/Firebird PHP extension on Zend Server CE for Mac OS X”

  1. Hi,

    I see you used the Classic, and I tried it with Superserver and got errors concerning libgds, libib_util or libfbclient. I’m assuming this is why..

    Hate to switch to classic, any thoughts as to a work around?

  2. Hi,

    do you know what should be the procedure to install Zend Server CE + pdo firebird + Debian 6 squeeze?


Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.