The forum will be down for maintenance over the weekend of August 18-20, 2017. The forum will be shut down on the evening (EDT) of Friday, August 18. Downtime is unknown but may be up to two days. The forum will be restarted as soon as maintenance is complete.

Hi,

My stack is:

Ubuntu 14.04 x64 (headless - shell access only)
SQL Anywhere 16 Developer Edition (I believe build 2043)
  (sqla16developerlinux.tar.gz, md5: 3e64a95cfb5704553a070d81d4195369)
PHP Version 5.5.9-1ubuntu4.5
nginx web server

I can get the SA16 PHP extension loading successfully, but when I activate libdbcapi.so, the PHP script crashes PHP and the browser shows "502 Bad Gateway" error from nginx.

Here are the steps I've done:

A. Created PHP script that executes phpinfo() and verified it runs successfully from my browser. This shows that the PHP/nginx part of the installation is working.

B. Copied the newest sa16 php extension files to the PHP extension directory, added the appropriate entry to php.ini, and restarted php:

sudo cp /opt/sqlanywhere16/lib64/php-5.5.0_sqlanywhere*.so /usr/lib/php5/20121212/
sudo vim /etc/php5/fpm/php.ini
<added the following line>
  extension=php-5.5.0_sqlanywhere.so
sudo service restart php5-fpm
Reloaded the browser window and now phpinfo() shows sqlanywhere loaded successfully, but without access to libdbcapi.so:
PHP SQLAnywhere driver version: 2.0.13.1
SQLAnywhere client version: The SQLAnywhere client libraries could not be loaded.
Please ensure that libdbcapi.so can be found in your LD_LIBRARY_PATH environment variable.
C. Created a new .conf file for ldconfig pointing to /opt/sqlanywhere16/lib64, updated ldconfig and restarted php:
sudo vim /etc/ld.so.conf.d/sqlanywhere.conf
<with the single line>
  /opt/sqlanywhere16/lib64
sudo ldconfig
sudo service restart php5-fpm
But now, when I run the PHP phpinfo() script in the browser, PHP crashes and I get
502 Bad Gateway

I suspect this may be some sort of version mismatch problem, but I'm using only the files that came with the distro. Does anyone have a suggestion as to what I might try next?

UPDATE: As a final step, I needed to add an entry to /etc/php5/fpm/pool.d/www.conf and restart php:

sudo vim /etc/php5/fpm/pool.d/www.conf
<add the line>
  env[LD_LIBRARY_PATH] = /opt/sqlanywhere12/lib64
sudo service restart php5-fpm

Now things work properly!

Thanks, Terry

asked 17 Jan '15, 15:19

Terry%20Wilkinson's gravatar image

Terry Wilkinson
511192336
accept rate: 28%

edited 18 Jan '15, 15:31


Probably not cool to answer one's own question, but I did figure out the problem.

As a final step, I needed to add an entry to /etc/php5/fpm/pool.d/www.conf and restart php:

sudo vim /etc/php5/fpm/pool.d/www.conf
<add the line>
  env[LD_LIBRARY_PATH] = /opt/sqlanywhere12/lib64
sudo service restart php5-fpm
I will edit the original post appropriately.

permanent link

answered 18 Jan '15, 15:27

Terry%20Wilkinson's gravatar image

Terry Wilkinson
511192336
accept rate: 28%

2

It is perfectly cool to answer your own question; this is not StackOverflow, there are no Antwort Betreuer squads here.

(18 Jan '15, 16:08) Breck Carter
Replies hidden
1

Antwort Betreuer

So that's another expression borrowed from German? Is that supported by SAP?

Volker the Besserwisser

(19 Jan '15, 04:12) Volker Barth
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:

×204
×61
×47
×14

question asked: 17 Jan '15, 15:19

question was seen: 2,751 times

last updated: 19 Jan '15, 04:12