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

Hi, I've been a long time user of SQL Anywhere, and I've just downloaded the latest for OSx. Everything is great, but after some searching around, I realized there was no pre-compiled version of the PHP module for OSx, although it is mentioned on the website for version 12. I've tried to compile & install it myself, but was not successful.

Is it possible a downloadable PHP module could be made available for OSx ?

Mac OSx 10.6.7 PHP 5.3.4

asked 20 Jun '11, 08:57

tomb's gravatar image

accept rate: 0%

You may have a look at this question.

From that it seems that there's no binary download for Mac OS X but you can build one yourself.

(20 Jun '11, 09:15) Volker Barth

You can compile the SQL Anywhere module as an extension:

$ cd <sqlanywhere module source directory>
$ phpize
$ make
$ make install

Once that's done, the module will be installed in your PHP extensions directory. You must also add an entry to your php.ini to load the module.

Now you need to ensure that the Apache process can find the SQL Anywhere client libraries.

What you need is the lib64 directory of your SQL Anywhere installation to be included in the DYLD_LIBRARY_PATH environment variable (LD_LIBRARY_PATH on Linux).

If you are using the "Web Sharing" option from your System Settings, you should be able to set this in /System/Library/LaunchDaemons/org.apache.httpd.plist

Add a tag something like:


This should go at the same depth as the other key tags.

If you are using another Apache installation, you will have to find the equivalent configuration file for your installation.

Note, too, that it is vital that the path you include (lib64 or lib32) refers to the same pointer size as the Apache process that's running.

permanent link

answered 21 Jun '11, 09:02

Phil%20Mitchell's gravatar image

Phil Mitchell
accept rate: 27%

edited 21 Jun '11, 14:02

Problem Solved! Thanks for the prompt support!! These few helpful hints would be a great thing to publish on your website for future reference on compiling and installing the PHP module, OSx & Unix.

(21 Jun '11, 13:51) tomb
Replies hidden

I'm glad you got it going. I've summarized the two most important comments as an answer. If you agree that the above steps solved your problem, then go ahead and mark the answer as accepted. Otherwise, let me know what I've missed.

(21 Jun '11, 14:03) Phil Mitchell

Well, I'd say this discussion here is already part of the published documentation to SQL Anywhere, PHP and Mac OS X by the very nature of this Q&A site...

Of course, this doesn't mean that particular documents (or DCX) could not be improved:)

(21 Jun '11, 17:04) Volker Barth

I will make a note to get a Mac OS X example posted somewhere. The reason I summarized the comments that led to an answer was so that it would be documented here on this forum. You are right, though. A more official documentation source would be nice.

(22 Jun '11, 08:16) Phil Mitchell

Up to this point, when i encounter such a problem, I always go to the website first for documentation and examples. So for myself, had there been a detailed & complete example with reasonable documentation for this case, it would have saved me a lot of time. That seems logical for things that aren't justified or driven by customer demands. In any case, I'm very happy to have the problem solved, very happy with the product, and appreciate the support found here.

(24 Jun '11, 08:20) tomb

FWIW, Mohammed is going to add a README to the source distribution that will include build instructions and a few specific examples for configuring Apache. This is the easiest thing for us to distribute and keep up to date. PHP is a moving target, whereas our docs and white-papers tend to be more static. Also, if you are looking for how to build and install the module, you will already have the source code.

(24 Jun '11, 09:38) Phil Mitchell
showing 1 of 6 show all flat view

There are currently no plans to maintain a downloadable binary version of the PHP driver for Mac OS X. Maintaining these binary downloads would require engineering and QA effort that we would like to be able to justify with significant demand from customers.

If you have trouble compiling the module, please post details about your specific problem and we'll do our best to help you.

permanent link

answered 20 Jun '11, 09:43

Phil%20Mitchell's gravatar image

Phil Mitchell
accept rate: 27%

edited 20 Jun '11, 09:44

Ok thank you, i do understand. I have successfully compiled php, including sqlanywhere, no compile errors, and i did a "sudo make install" also with no errors, but when i restart apache, its still running the old version of PHP. I think the new version is being installed in /usr/local/bin, instead of /usr/bin This is my best guess.

Any suggestions would be appreciated.


(20 Jun '11, 11:13) tomb
Replies hidden

So you are compiling the SQL Anywhere module into PHP? Okay. Once you have it compiled, you will need to update the PHP module that's installed in Apache.

This may vary depending on your system. I found this blog post that might be helpful:

(20 Jun '11, 11:32) Phil Mitchell

The alternative method is to leave the current PHP installation in place. You can compile the SQL Anywhere module as an extension:

$ cd <sqlanywhere module source directory>
$ phpize
$ make
$ make install

Once that's done, the module will be installed in your PHP extensions directory. You must also add an entry to your php.ini to load the module. Then it will be done.

(20 Jun '11, 11:36) Phil Mitchell

Finally, you alternative worked, thank you! I have apache on my mac that is aware of sqlanywhere. I still have a problem on OSx that i previously had on Linux. The SQLAnywhere client version indicates this: "The SQLAnywhere client libraries could not be loaded. Please ensure that can be found in your LD_LIBRARY_PATH environment variable."

To solve this on Linux, (fedora) I had to create the following file: /etc/sysconfig/httpd In this file i put "source /Applications/SQLAnywhere12/System/bin64/" I believe apache reads this file when starting up, and knows where the client libraries are.

I have no idea where, or what file to modify on OSx so apache will load the SQLAnywere client libraries.

Suggestions would be greatly appreciated once again!


(20 Jun '11, 14:17) tomb
Replies hidden

Tom: FYI, note that I have been converting your responses (which have been answers) to comments. Rather than adding an answer when responding to a person's comment please use the "reply" button (the little box with arrow pointing up-and-right) which appears under each comment ... unless you are actually adding an answer to your original question. Thanks.

(20 Jun '11, 15:40) Mark Culp

Ok, thanks Mark.

(20 Jun '11, 16:23) tomb
showing 2 of 6 show all flat view
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: 20 Jun '11, 08:57

question was seen: 6,434 times

last updated: 24 Jun '11, 09:38