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-fpmReloaded the browser window and now phpinfo() shows sqlanywhere loaded successfully, but without access to libdbcapi.so:
PHP SQLAnywhere driver version: 22.214.171.124 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
502 Bad Gateway
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!
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-fpmI will edit the original post appropriately.
answered 18 Jan '15, 15:27