Hi to everyone!

I am trying to connect from an OpenSuse 15.3 Linux server, more precisely, from PHP Version 7.4.6 (Apache2 module) to SQL Anywhere Server Version 16.0.0.1948 on another machine in my LAN.

In the past I have been connecting to the same server from PHP 5.x, and this was easy because there was an PHP extension in the SQL Anywhere Client package. This extension is lacking for PHP 7.4.6, unfortunately.

What can I do?

In the PHP documentation (https://www.php.net/manual/en/intro.uodbc.php) it says:

"Introduction In addition to normal ODBC support, the Unified ODBC functions in PHP allow you to access several databases that have borrowed the semantics of the ODBC API to implement their own API. Instead of maintaining multiple database drivers that were all nearly identical, these drivers have been unified into a single set of ODBC functions. The following databases are supported by the Unified ODBC functions: » Adabas D, » IBM DB2, » iODBC, » Solid, and » Sybase SQL Anywhere. Note: With the exception of iODBC, there is no ODBC involved when connecting to the above databases. The functions that you use to speak natively to them just happen to share the same names and syntax as the ODBC functions. However, building PHP with iODBC support enables you to use any ODBC-compliant drivers with your PHP applications. More information on iODBC, is available at » www.iodbc.org with the alternative unixODBC available at » www.unixodbc.org."

This sounds as if I could connect using the PHP-ODBC-extension. But I have trouble getting things up and running. My questions:

1) Do I have to use unixODBC in addition to the PHP extension or is the PHP ODBC extension all I need? 2) There are some ODBC libraries in the SQL Anywhere 16 client package, see below. Do I have to use one of these? Which one? And how?

lrwxrwxrwx 1 root root      17  6. Jul 11:21 ../lib64/libdbjodbc16.so -> libdbjodbc16.so.1
-r-xr-xr-x 1 root root  766576  6. Jul 11:21 ../lib64/libdbjodbc16.so.1
lrwxrwxrwx 1 root root      18  6. Jul 11:21 ../lib64/libdbodbc16_n.so -> libdbodbc16_n.so.1
-r-xr-xr-x 1 root root 1500304  6. Jul 11:21 ../lib64/libdbodbc16_n.so.1
lrwxrwxrwx 1 root root      18  6. Jul 11:21 ../lib64/libdbodbc16_r.so -> libdbodbc16_r.so.1
-r-xr-xr-x 1 root root 1529328  6. Jul 11:21 ../lib64/libdbodbc16_r.so.1
lrwxrwxrwx 1 root root      16  6. Jul 11:21 ../lib64/libdbodbc16.so -> libdbodbc16.so.1
-r-xr-xr-x 1 root root  134696  6. Jul 11:21 ../lib64/libdbodbc16.so.1
lrwxrwxrwx 1 root root      22  6. Jul 11:21 ../lib64/libdbodbcansi16_r.so -> libdbodbcansi16_r.so.1
-r-xr-xr-x 1 root root 1525528  6. Jul 11:21 ../lib64/libdbodbcansi16_r.so.1
lrwxrwxrwx 1 root root      22  6. Jul 11:21 ../lib64/libdbodbcinst16_r.so -> libdbodbcinst16_r.so.1
-r-xr-xr-x 1 root root  509056  6. Jul 11:21 ../lib64/libdbodbcinst16_r.so.1
lrwxrwxrwx 1 root root      20  6. Jul 11:21 ../lib64/libodbcinst.so -> libdbodbcinst16_r.so
lrwxrwxrwx 1 root root      22  6. Jul 11:21 ../lib64/libodbcinst.so.1 -> libdbodbcinst16_r.so.1

3) Will the SQL Anywhere server accept ODBC connections at all? Do I have to configure this?

Any help or hint is appreciated!

asked 09 Jul '21, 06:50

Dingoloni's gravatar image

Dingoloni
30114
accept rate: 0%


This page says PHP 7.4 is supported: The SAP SQL Anywhere PHP Module.

permanent link

answered 09 Jul '21, 06:59

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

Breck, I love you! You made my day!

I don't know why I had not found that page.

Works like a charm.

permanent link

answered 09 Jul '21, 07:59

Dingoloni's gravatar image

Dingoloni
30114
accept rate: 0%

> why I had not found that page

Here's why: The page is located in a little-known area called the "SQL Anywhere Wiki".

I found it by starting here SAP Help Portal for SQL Anywhere 17 and then doing a This product search for php support.

That (almost) brought me to this page SQL Anywhere PHP Extension which has a link...

...to this off-site wiki page The SAP SQL Anywhere PHP Module.

Important points...

The V17 SAP Help Portal contains the most up-to-date Help, useful even if you are using earlier versions... new material appears here.

Always make sure you're searching This product because it has an annoying habit of switching to This document.

You can download all of the V17 Help as PDFs, one by one, by following the link from each Portal "book"... it takes forever, but nothing beats your local drive for safety.

(09 Jul '21, 10:27) Breck Carter
Replies hidden
1

Searching within this forum with tag "php" might give the fastest answers, methinks.

(09 Jul '21, 11:21) Volker Barth

Show me how that gets you to the Wiki page that has the download link to get the PHP module.

(10 Jul '21, 06:38) Breck Carter
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×145
×70

question asked: 09 Jul '21, 06:50

question was seen: 1,814 times

last updated: 10 Jul '21, 06:38