cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Anywhere 11 on Ubuntu / PHP

Former Member
0 Kudos

Hi there,

I have been trying (with no success) to connnect our PHP app to Sybase database.

Our actual scenario is:

Windows2003/ ODBC {SQL Anywhere 11 Driver} / PHP ------> Windows2008 / Sybase

We are to migrate our PHP:

Linux Ubuntu Server / UnixOBC {SQL Anywhere 11 ODBC Driver} / PHP -------> Windows2008 / Sybase

In the migration process I configured FreeTDS trying somethink like:

/etc/fretds/freetds.conf

----------

[global]
    tds version = 4.2

    dump file = /tmp/freetds.log
;    debug flags = 0xffff

;    timeout = 10
;    connect timeout = 10

    text size = 64512


[sybase]
    host = 172.19.2.252
    port = 2640
;    instance = ek_cadu_0103040607
    tds version = 5.0
    ASA database = ek_adm01_11

---------

php-script

---------

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

$cnn = sybase_connect('sybase', 'dba', '_._ENKONTROL_._');

?>

---------

This script shows the following errors:

Warning: sybase_connect(): message: SQL Anywhere Error -83: Specified database not found (severity 16) in /var/www/testodbc.php on line 4

Warning: sybase_connect(): General SQL Server error: Check messages from the SQL Server (severity 16) in /var/www/testodbc.php on line 4 Warning: sybase_connect(): Unable to connect to server: sybase in /var/www/testodbc.php on line 4

Can anyone help?. Thank you in advance.

Marinho.

Accepted Solutions (1)

Accepted Solutions (1)

jeff_albion
Employee
Employee
0 Kudos

Hi Marinho,

SQL Anywhere does not support FreeTDS. SQL Anywhere does support Open Client and jConnect connections over TDS.

The sybase_* functions pre-built with PHP are for (Sybase) Adaptive Server Enterprise (ASE), not SQL Anywhere - they are separate products.

---

Is there a particular reason you're not using the SQL Anywhere PHP module ( http://scn.sap.com/docs/DOC-40537 ), with the sasql_* functions that are intended for use with SQL Anywhere?

Regards,

Jeff Albion

SAP Active Global Support

Former Member
0 Kudos

Hi Jeff,

Thanks for your quick response.

I heard about Sasql module for PHP, but I thought things could work as they were, the only thing that would change was the OS.

Now I'll try the solution you mention and I'll get back with comments,

Regards,

Marinho.-

Answers (0)