I've finally got PHP 5.0.5 running under Apache2 on Solaris 8 ... connecting to Sybase ASE servers 12.0 and 12.5 using CT-LIB 12.5.
The following was my build procedure -
Edit httpd.conf, adjusting directives to suit the local environment.
Following advice given above, update the Sybase version string in the PHP sybase_ct module header file:
change this line ...
#define CTLIB_VERSION CS_VERSION_100
#define CTLIB_VERSION CS_VERSION_125
SYBASE=/..../..../sybase12_5 <<-- path to your Sybase distribution root
export SYBASE SYBASE_OCS PATH LD_LIBRARY_PATH
NOTE: 'make test' will almost certainly fail all of the Sybase functionality, unless you update the test include file to use valid connectivity details for your local server:
// Change if needed
Edit Apache's httpd.conf file to associate .php files with a MIME type:
# PHP script support
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
Edit the apachectl script, inserting the following variable declarations after environment variables are imported:
export SYBASE SYBASE_OCS LD_LIBRARY_PATH
Ensure you have an 'interfaces' file in the root of your sybase distribution (Above the OCS-12_5 subdirectory), containing a server entry in the following format for each server you want to connect to:
<tab> master tcp ether <hostname> <port>
<tab> query tcp ether <hostname> <port>
(if this is your dataserver machine, there will be at least 1 entry already for the local dataserver. It is advisable to install all of the above on a separate machine though, with its own copy of the sybase client)
Cross fingers, and:
If you get 'relocation' errors when starting Apache with the php module configured to load, check the output of 'ldd libphp5.so'. Each of the Sybase libraries should link to files under your Sybase client distribution:
libtcl.so => /.../sybase12_5/OCS-12_5/lib/libtcl.so
libintl.so.1 => /.../sybase12_5/OCS-12_5/lib/libintl.so.1
libcomn.so => /.../sybase12_5/OCS-12_5/lib/libcomn.so
libct.so => /.../sybase12_5/OCS-12_5/lib/libct.so
libcs.so => /.../sybase12_5/OCS-12_5/lib/libcs.so
<snip other libraries>
If you see 'libintl.so' linking anywhere else, this is likely because the PHP build has incorrectly linked to a slightly different filename - libintl.so.1 - which doesn't exist in the Sybase client. Unfortunately a completely unrelated library of the same name does exist elsewhere in Unix! (Apparently the Sybase version was created before the duplicate was introduced into Unix).
My workaround was to create the following symlink in sybase client library 'lib' directory -
libintl.so.1 -> ./libintl.so*
'make distclean' in your PHP build directory, and repeat the build as above.