Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.


I try to get a sql anywhere connection under PHP with a apache2 server and suPHP installed. System: Debian Squeeze 64 Bit

When I just load the (built from source ( or downloaded the prebuilt one) then I receive this error:

The SQLAnywhere client libraries could not be loaded. Please ensure that can be found in your LD_LIBRARY_PATH environment variable.

I tried setting the LD_LIBARY_PATH in the start script of apache2 and olso fo apache2ctl, but this does not help. (Looks like suPHP is not passing it over...?)

When I copy over all /opt/sqlanywhere10/lib64 files to /usr/lib then I receive always a server error 500 (Premature end of script headers: phpinfo.php)

Any hints how to solve this ?


asked 07 Dec '11, 12:40

ASchild's gravatar image

accept rate: 14%

After some more searching I have finaly found this answer:

Looks like suPHP clears the LD_LIBRARY env var before starting the PHP interpreter. After applying the patch I can now connect to the database server


permanent link

answered 07 Dec '11, 12:57

ASchild's gravatar image

accept rate: 14%

For an alternative to setting LD_LIBRARY_PATH, see SQLAnywhere 12 on Ubuntu 11.10 linux, nginx & php

permanent link

answered 01 May '12, 20:09

Mark's gravatar image

accept rate: 20%

edited 01 May '12, 20:10

Nice solution, just add it to the global /etc/


(02 May '12, 12:17) ASchild
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: 07 Dec '11, 12:40

question was seen: 3,643 times

last updated: 02 May '12, 12:17