All we need is an easy explanation of the problem, so here it is.
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:
- Already verified libdbodbc17_r.so file is there.
- Necessary permission is already given.
- Able to connect using Telnet and command line to SQL Anywhere 17.
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
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
Create a file
/etc/ld.so.conf.d/sqlanywhere17.conf with this content
Then restart apache and it should be able to connect
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂