cancel
Showing results for 
Search instead for 
Did you mean: 

Building PHP Module for SQLA 17 on Mac OS High Sierra

2,405

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.

http://dcx.sap.com/sqla170/en/html/3bda5df06c5f1014bda2e294745f9008.html

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 https://php-osx.liip.ch

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

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

http://dcx.sap.com/sqla170/en/html/3bda5df06c5f1014bda2e294745f9008.html

VolkerBarth
Contributor
0 Kudos

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

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.

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 https://www.getgrav.org/blog/macos-sierra-apache-multiple-php-versions. 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