Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in August and this forum will be retired.

I've been following the instructions for building the PHP module for SQL Anywhere 17, and the make command was initially failing

The build process is documented here.

The instructions indicate that php5-dev is to be used for building the module. I had a php 7 install initially.

I confirmed that the build failed because of the php7 install by installing php5-dev using the package for php 5.6 at

With this installed the build ran successfully with a couple of warnings, we'll see if these cause any issues.

Its a bit disappointing to discover the lack of php7 support as I have a php7 codebase I'm working on for a customer, I think I can still use the php5 compatible module but it would have been better if php7 had been supported

I tend to recommend Linux to my customers, and I guess I'll have to factor in a docker install in future for the SQLAnwhere/php combination for development.

asked 15 Jun '18, 13:58

paulfreeman's gravatar image

accept rate: 0%

edited 15 Jun '18, 19:37

Have you noticed that page from the SQL Anywhere Wiki:

The SAP SQL Anywhere PHP Module

In my understanding, it should provide you with code working with PHP 7. Note, I have not used PHP with OSX.

(17 Jun '18, 06:44) Volker Barth

Thanks Volker, I saw that but assumed that the Linux builds might not be right for Mac OS, but it seems worth a try.

I will try it out as you suggest.

(17 Jun '18, 06:58) paulfreeman
Replies hidden

Well, I don't meant that the prebuilt Linux libraries are usable with OSX. Instead I wanted to point to the source code download available there so you can build them yourself - the "changes" file within the there tells:

Changes in version 2.0.17   1st March 2017
  o Support for PHP v7.

so v7 support is available.

I certainly agree that it's somewhat hidden within the current links from the SQL Anywhere 17 help.

(17 Jun '18, 07:55) Volker Barth

Thanks again, I did look in the source, before my initial post but for some reason I did not see that. I'll have another look.

(17 Jun '18, 14:22) paulfreeman

I think it would be more 'developer friendly' if this web page carried information about version support in the section "Building the Driver from Source". It would have enabled me to locate the correct version much quicker, and would probably help other people too.

Because it's so hard to find the complete set of web documents describing the whole process, its hard to make inferences like "Although all the drivers listed on this page don't support Mac OS, the source link will", because its hard to judge the recency or accuracy of any of the weblinks.

It would be a great help if the heading for the source was written with a bit more information such as

"Building the driver from source (Linux, Windows, Mac OS, PHP versions up to 7)"

and include a link under there as well to the build process

permanent link

answered 18 Jun '18, 04:42

paulfreeman's gravatar image

accept rate: 0%

Fully agreed. So I can conclude you could build the driver successfully on OSX?

(18 Jun '18, 07:06) Volker Barth

Actually I decided to get the install working with php 5.6.33 as I already succeeded in compiling the module for that before finding out the source was compatible and I have a number of other dependencies to install.

Another complication was that 'make test' failed in the build with LD_LIBRARY_PATH errors so I had to investigate how to prevent these

I have now finally managed to configure SQLA 17 with 5.6.33 and a fresh install of Apache with PHP and have it successfully seeing the SQLA installation.

I figured if I hit any PHP code issues later because of not using php 7 I can more easily go through the build/installation with 7 if I hit a problem, most of the source php looks compatible with 5 in any case.

I have other problems now in connecting to the database from PHP, but at least it looks as if php can see sqlanywhere and send it commands, as I'm just hitting 'database not found' errors.

(18 Jun '18, 10:45) paulfreeman

So now I've built the PHP 7 module and installed it also and its working, thanks to @Volker's input

Note that the module build instructions include running the "make test" target, this gives a library missing error, but it can be ignored.

I found the PHP installation and switching approach in the following very useful, note that the httpd.conf configuration works while keeping the system installed version of Apache on High Sierra also and its optional whether to install Apache cleanly as he recommends. I kept the existing Apache version as it made the process a bit simpler to start with With this version its possible to quickly switch PHP versions in Apache.

Some documentation on the SAP docs suggests the use of a developer version of PHP for building the source for the SQLAnywhere PHP module, I found this is not necessary with the brew installed versions of PHP, I built the latest source against PHP 7.2. installed by brew according to those instructions

(19 Jun '18, 01:36) paulfreeman
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 15 Jun '18, 13:58

question was seen: 1,897 times

last updated: 19 Jun '18, 01:40