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:
- 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:
#!/bin/sh 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 fi 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 fi echo "Remove Framework" rm -fr /Library/Frameworks/Firebird.framework echo "Remove Receipt" rm -fr /Library/Receipts/Firebird*.pkg
- 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!
- 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
- 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.gzfile and copy a
php-sourcedirectory to a
- From Terminal:
cd /usr/local/zend/share/php-source/php-5.3.2/ext/interbase phpize
- 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 make install
- Restart Zend Server.
Done! Good luck 🙂