Hi all,
I finally managed to get the PHP working with Sybase.
Here's a mini-mini-HOWTO for getting PHP 4.x working with Sybase 11.9.x and Mandrake Linux 8.2 (also I guess latest RedHat etc).
- Downloading / Installing
Install Mandrake Linux with Apache and all necessary PHP modules.
Note, php-sybase module supplied with the installation does not appear to be working (see my earlier posts - if anyone knows what the problem is, please let me know).
Install php-devel package.
Install freetds and freetds-devel packages.
Download and install Sybase packages from www.sybase.com
- Compiling
Copy /usr/src/php-devel/extensions/sybase_ct/* into a temporary directory.
Run 'phpize'
Edit 'configure' script and delete all references to:
-lcs
-linsck
-lintl
-lcomn
-lsybtcl
Run './configure --with-php-config=/usr/bin/php-config --with-sybase-ct=/usr'
Run 'make'
If everything's ok. Copy the resulting modules/sybase_ct.so to /usr/lib/php/extensions
- Configuration
Add the following line to /etc/php.ini :
extension = sybase_ct.so
Add the following line to /etc/rc.d/init.d/httpd :
export SYBASE=/usr
Edit /etc/freedts.conf and add details for you Sybase server.
- Complete
This should be it. $SYBASE variable of /usr (instead of /opt/sybase or /usr/share/freetds) works fine for me as freetds rpm copies the libraries directly to /usr/lib and /usr/include.
I'm not sure why Sybase libraries or Mandrake's php-sybase module do not work properly. I spent a week trying to fix the problems. I only managed to get it working with the method above.
Good luck.
Regards,
Tazza