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.

Hy!

I have a problem that I can't seem to solve it. I was hoping for some help from here because I tried almost everything that came through my mind.

I have a fresh system of linux distribution CentOS 6.2 64bit. I installed httpd, mysql and php. Installed php client that I downloaded here (http://www.sybase.com/detail?id=1087327), added PHP extension that i downloaded here (http://www.sybase.com/detail?id=1019698) ant that should be it.

Phpinfo(); said »The SQL Anywhere client libraries could not be loaded. Please ensure that libdbcapi.so can be found in your LD_LIBRARY_PATH enviroment varible.« so i executed this:

source /opt/sqlanywhere12/bin32/sa_config.sh

Now for the funky part: PHP in HTTPD still doesn’t work, BUT if I run the script in console with:

php /var/www/html/testdb.php

it works OK

Some googling later i found that i have to add some little thing in »/etc/init.d/httpd«:

start() { 
      echo "Starting sqlanywhere variables..."
      source /opt/sybase/SYBSsa9/bin/asa_config.sh
    .
    .
}

Now, everything loads as it should, but the testdb.php doesnt work. It shows me an error:

Warning: sasql_connect(): SQLAnywhere: [-832] Connection error: Cannot create resource tree in /var/www/html/testdb.php

Or

Warning: sasql_connect(): SQLAnywhere: [-100] Database server not found in /var/www/html/testdb.php

Again, the PHP file works from console if I start the sa_config.sh before executing the script.

I’m suspecting this all has something to do with environment variables or some read/write problems. The folder /tmp looks OK so I don’t see the problem! I tried reinstalling the system, installing 32bit version but I always end up with the same error.

My connection string is:

$connection = sasql_connect("ENG=asa;DBN=*****;UID=*****;PWD=*****;COMMLINKS=TCPIP{IP=192.168.0.111;DoBroadcast=NONE};cs='utf-8'");

Please help..

asked 26 Apr '12, 15:11

TadejZ's gravatar image

TadejZ
1111
accept rate: 0%


Running the sa_config.sh script sets local environment variables in your terminal, so php within the terminal works. But the httpd server is in a different environment, probably a different user and may not be able to use the LD_LIBRARY_PATH, hence the phpinfo() error. Don't use the LD_LIBRARY_PATH at all, despite the error message.

I ran into some issues setting up sqlanywhere on linux, see: SQLAnywhere 12 on Ubuntu 11.10 linux, nginx & php

Hope it helps your CentOS config. Since setup, about 6 months ago, sqlanywhere has been running like clockwork. I use it for development daily.

permanent link

answered 30 Apr '12, 22:01

Mark's gravatar image

Mark
2565917
accept rate: 20%

Is SELinux enabled? Try disabling it. It may not be an issue when you run from a console, but when apache is running as a limited user, there may be issues. If disabling SELinux helps, but you actually care about having SELinux enabled, you'll have to set up file access permissions. There is an selinux directory in your SQL Anywhere install that contains a sample policy for SQL Anywhere. It was written for RHEL 5.0, so it may be out of date for your distro.

permanent link

answered 07 May '12, 10:48

Phil%20Mitchell's gravatar image

Phil Mitchell
1.9k1831
accept rate: 27%

edited 07 May '12, 10:49

There is an existing discussion related to the error "cannot create resource tree".

permanent link

answered 26 Apr '12, 21:34

Chris%20Keating's gravatar image

Chris Keating
7.8k49128
accept rate: 32%

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:

×70
×68
×48
×43
×5

question asked: 26 Apr '12, 15:11

question was seen: 13,191 times

last updated: 07 May '12, 10:49