I'm trying to connect Sybase 17 from PHP(7.4, 8.0) Laravel running on apache2 on Ubuntu(18.4) system. We are using SQL Anywhere. Sybase is not installed on the same server.

We are getting this error - Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/opt/sqlanywhere17/lib64/libdbodbc17_r.so' : file not found, SQL state 01000 in SQLConnect in /var/www/html/sybaseconnection.php on line 14

We've already performed the below steps:

  1. Already verified libdbodbc17_r.so file is there.
  2. Necessary permission is already given.
  3. Able to connect using Telnet and command line to SQL Anywhere 17.

1 Answer 1


It can probably not load the file, since that file has some more dependencies.

I would suggest to do these two things: Include the content of /opt/sqlanywhere17/bin64/sa_config.sh into /etc/apache2/envvars


Create a file /etc/ld.so.conf.d/sqlanywhere17.conf with this content


Then restart apache and it should be able to connect


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.