Similar to compiling XHProf for Snow Leopard, installing any new PHP extension is usually easy. The MS-SQL extension, specifically, requires an additional library called FreeTDS. The linking tools included do not work well with Snow Leopard and need to be replaced. Here are the steps I took to compile FreeTDS and the MS-SQL extension -
-
Download PHP and FreeTDS sources.
NOTE: The PHP version needs to match your DAMP (or other server) installation. -
Navigate to the mssql/ folder inside the PHP source -
cd /path/to/php/ext/mssql- Run configure for FreeTDS -
CFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --prefix=/usr/local/freetds --enable-msdblib --with-tdsver=8.0- Run phpize and configure for the MS-SQL extension -
phpize
CFLAGS='-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5' \
./configure --with-php-config=/Applications/acquia-drupal/php/bin/php-config --with-mssql=/usr/local/freetds- Copy the libtool created by the configure command in PHP into the FreeTDS source folder -
cp /path/to/php/ext/mssql/libtool /path/to/freetds/- Compile and install FreeTDS -
make && make install- Compile the MS-SQL extension and copy to the DAMP installation -
cd /path/to/php/ext/mssql
make
cp modules/mssql.so /Applications/acquia-drupal/php/ext/- Configure PHP to load the new MS-SQL extension -
cat >> /Applications/acquia-drupal/php/bin/php.ini <<EOF
[mssql]
extension=mssql.so
EOF- Restart DAMP


Add new comment