PDA

View Full Version : Sybase SQL Anywhere PHP extension



vatson
25-Mar-2013, 18:52
Hello!

I'm running SLES11 SP2 with Apache and PHP installed from official SLES repositories. Now I need to connect to Sybase SQL Anywhere 12 database from within PHP. First I tried with FreeTDS (actually I tried that from another OS, not SLES), but the good folks that manage our SQL Anywhere system laughed at me and said that FreeTDS is not compatible with this particular version of SQL Anywhere and I should instead use the PHP extension that is provided by Sybase, as described on Sybase website: http://dcx.sybase.com/index.html#1201/en/dbprogramming/pg-deploy-php.html

Problem is, I can't get it running. After properly installing the required Sybase client libraries, making sure they are found by ldconfig and configuring PHP to load the necessary extension (php-5.2.13_sqlanywhere_r.so) and restarting Apache I can no longer access any .php pages on the server. The only thing that is in server's PHP errorlog is this:
PHP Warning: request_startup() for sqlanywhere module failed in Unknown on line 0
and browser gives a message to the effect that "the connection was reset".

Before I dig any deeper I thought to ask, has anyone managed to use this SQL Anywhere extension on SLES?

The thing that catches my eye is that PHP on SLES is version 5.2.14, but Sybase extension download page (http://www.sybase.com/detail?id=1019698) provides only 5.2.13, which is what I've been trying. Maybe I need to compile the extension myself for 5.2.14?

vatson
26-Mar-2013, 17:03
With the help of some very smart people I managed to get the extension loaded. I was missing two things:
1. In addition to libraries in /opt/sqlanywhere12/lib32, some files in /opt/sqlanywhere12/res are also needed. I copied over the entire res directory, but I believe that the only file actually needed is dblgen12.res.
2. Environment variable SQLANY12 needs to be set. I achieved this by adding the following line to the end of /etc/sysconfig/apache2:

export SQLANY12=/opt/sqlanywhere12

askadj
18-May-2016, 18:37
With the help of some very smart people I managed to get the extension loaded. I was missing two things:
1. In addition to libraries in /opt/sqlanywhere12/lib32, some files in /opt/sqlanywhere12/res are also needed. I copied over the entire res directory, but I believe that the only file actually needed is dblgen12.res.
2. Environment variable SQLANY12 needs to be set. I achieved this by adding the following line to the end of /etc/sysconfig/apache2:

export SQLANY12=/opt/sqlanywhere12

In (1) you said you copied over the whole res directory. Where did you copy it to?