Page 1 of 1

Connecting to remote server/sage using php?

Posted: Wed Mar 19, 2008 5:38 am
by MercJones
Hi there.

Just wondering if any of you have any suggestions/experience on connecting to sage using php.

I know you need the odbc extension, which ive added to php.ini, and then ive done sudo aptitude install php5-odbc, which phpinfo() has picked up, but im trying to connect and get:

SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect

so I dont know if I need another driver or whatever?

Also, i read you may need to edit odbc.ini in /etc/ this exists but is empty.

The problem gets worse becuase you normally use code similar to:

<?php
$rConn = odbc_connect("SageLine50V10", "user", "pass");

$rRes = odbc_tables($rConn);

odbc_result_all($rRes);
odbc_close($rConn);
?>

but we want to connect to a remote IP, instead of one on the same server running php.

Any ideas please?

Cheers