<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Trouble getting PHP working with SQL Anywhere16 under Linux/Ubuntu in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaa-p/13848307#M4879150</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Antwort Betreuer&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So that's another expression borrowed from German? Is that supported by SAP?&lt;/P&gt;
&lt;P&gt;Volker the Besserwisser&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jan 2015 04:12:27 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2015-01-19T04:12:27Z</dc:date>
    <item>
      <title>Trouble getting PHP working with SQL Anywhere16 under Linux/Ubuntu</title>
      <link>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaq-p/13848304</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;My stack is:&lt;/P&gt;
&lt;PRE&gt;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
&lt;/PRE&gt;

&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here are the steps I've done:&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;B. Copied the newest sa16 php extension files to the PHP extension directory, added the appropriate entry to php.ini, and restarted php:
&lt;/P&gt;&lt;PRE&gt;sudo cp /opt/sqlanywhere16/lib64/php-5.5.0_sqlanywhere*.so /usr/lib/php5/20121212/
sudo vim /etc/php5/fpm/php.ini
&amp;lt;added the following line&amp;gt;
  extension=php-5.5.0_sqlanywhere.so
sudo service restart php5-fpm
&lt;/PRE&gt;
Reloaded the browser window and now phpinfo() shows sqlanywhere loaded successfully, but without access to libdbcapi.so:
&lt;PRE&gt;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.&lt;/PRE&gt;
C. Created a new .conf file for ldconfig pointing to /opt/sqlanywhere16/lib64, updated ldconfig and restarted php:
&lt;PRE&gt;sudo vim /etc/ld.so.conf.d/sqlanywhere.conf
&amp;lt;with the single line&amp;gt;
  /opt/sqlanywhere16/lib64
sudo ldconfig
sudo service restart php5-fpm
&lt;/PRE&gt;
&lt;STRIKE&gt;But now, when I run the PHP phpinfo() script in the browser, PHP crashes and I get
&lt;/STRIKE&gt;&lt;PRE&gt;&lt;STRIKE&gt;502 Bad Gateway&lt;/STRIKE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;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?&lt;/STRIKE&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;UPDATE:&lt;/B&gt;
As a final step, I needed to add an entry to /etc/php5/fpm/pool.d/&lt;A href="http://www.conf" target="_blank"&gt;www.conf&lt;/A&gt; and restart php:
&lt;/P&gt;&lt;PRE&gt;sudo vim /etc/php5/fpm/pool.d/&lt;A href="http://www.conf" target="_blank"&gt;www.conf&lt;/A&gt;
&amp;lt;add the line&amp;gt;
  env[LD_LIBRARY_PATH] = /opt/sqlanywhere12/lib64
sudo service restart php5-fpm
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Now things work properly!&lt;/P&gt;
&lt;P&gt;Thanks,
Terry&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jan 2015 15:19:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaq-p/13848304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-17T15:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble getting PHP working with SQL Anywhere16 under Linux/Ubuntu</title>
      <link>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaa-p/13848305#M4879148</link>
      <description>&lt;P&gt;Probably not cool to answer one's own question, but I did figure out the problem.&lt;/P&gt;
&lt;P&gt;As a final step, I needed to add an entry to /etc/php5/fpm/pool.d/&lt;A href="http://www.conf"&gt;www.conf&lt;/A&gt; and restart php:
&lt;/P&gt;&lt;PRE&gt;sudo vim /etc/php5/fpm/pool.d/&lt;A href="http://www.conf"&gt;www.conf&lt;/A&gt;
&amp;lt;add the line&amp;gt;
  env[LD_LIBRARY_PATH] = /opt/sqlanywhere12/lib64
sudo service restart php5-fpm
&lt;/PRE&gt;
I will edit the original post appropriately.&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Jan 2015 15:27:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaa-p/13848305#M4879148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-18T15:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble getting PHP working with SQL Anywhere16 under Linux/Ubuntu</title>
      <link>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaa-p/13848306#M4879149</link>
      <description>&lt;P&gt;It is perfectly cool to answer your own question; this is not StackOverflow, there are no Antwort Betreuer squads here.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Jan 2015 16:08:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaa-p/13848306#M4879149</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2015-01-18T16:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble getting PHP working with SQL Anywhere16 under Linux/Ubuntu</title>
      <link>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaa-p/13848307#M4879150</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Antwort Betreuer&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So that's another expression borrowed from German? Is that supported by SAP?&lt;/P&gt;
&lt;P&gt;Volker the Besserwisser&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2015 04:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/trouble-getting-php-working-with-sql-anywhere16-under-linux-ubuntu/qaa-p/13848307#M4879150</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-01-19T04:12:27Z</dc:date>
    </item>
  </channel>
</rss>

