Hi, i'm running SQLAnywhere, (12.0.1.3723) on Fedora 16 (3.4.2-1.fc16.x86_64) and I can't connect with PHP in the browser. http://thesite/phpinfo.php gives me the following: "The SQLAnywhere client libraries could not be loaded. Please ensure that libdbcapi.so can be found in your LD_LIBRARY_PATH environment variable." I have my usual config & setup on Fedora ... as shown here: in directory /usr/lib64/php/modules i have the following: php-5.3.2_sqlanywhere.so -> /opt/sqlanywhere12/lib64/php-5.3.2_sqlanywhere.so in /etc/php.ini I have: extension=php-5.3.2_sqlanywhere.so in /etc/sysconfig/httpd i have: source /opt/sqlanywhere12/bin64/sa_config.sh If i run the same phpinfo.php from a shell, it works .. as shown here: SQLAnywhere client version => 12.0.1.3723 I can't figure out what I'm missing for apache to load the client libraries. Any help will be greatly appreciated! |
Just finished Fedora16 install on virtual machine and did some digging around system configuration. The file My solution is to create a custom shell script file to 1) prepare SA12
environment and 2) to start httpd service. I pastebined it here:
http://pastebin.com/iyS3XnY0 Put it in, let's say, /usr/sbin and
ExecStart=/usr/sbin/my-httpd Restart httpd.service (via systemctl) and hopefully it should work now. Hi, that works! beauty! Good solution, thanks a lot.
(10 Jul '12, 13:13)
tomb
|
It's
Check after apache restart your HTH Hi, thanks for that. I didn't mention above that I have this line in my /etc/sysconfig/httpd file: source /opt/sqlanywhere12/bin64/sa_config.sh I believe that does what you've mentioned here, and normally this works fine. I'm still at a complete loss right now.
(06 Jul '12, 09:15)
tomb
Yes, sa_config.sh does this and a little more. It prepares environment. As for your problem - check permissions. phpinfo.php in console runs from your user's environment, apache has it's own. Also you can try to give a full path to php-5.3.2_sqlanywhere.so in php.ini
(06 Jul '12, 09:29)
kaaposc
Replies hidden
I've tried both things with no success. I've also noticed that if I add the php-5.3.2_sqlanywhere.so into the php.ini file, in any form, i get this message when i do a phpinfo.php at the command line: Module 'sqlanywhere' already loaded in Unknown on line 0 I don't know why or where its already loaded from, and it still doesn't work in the browser.
(06 Jul '12, 13:53)
tomb
Hi, ok, i now have 2 machines running Fedora core 16, SQLAnywhere 12, and they both have the same problem as discussed here. I have another older machine running Fedora Core 12, SQLAnywhere 11, and it runs just fine. All machines have the same basic configuration as shown above. Is there a difference with the newer OS, or SQLAnywhere ? here is the Environment for apache (phpinfo.php): PATH: $SQLANY12/bin64:$SQLANY12/bin32:${PATH:-} SQLANY12: /opt/sqlanywhere12 LD_LIBRARY_PATH: $SQLANY12/lib64:${LD_LIBRARY_PATH:-} I currently have one client down, any help will be greatly appreciated!!
(09 Jul '12, 10:52)
tomb
Hi, I have found a solution for this problem, but it is far beyond my pay scale. If I start apache with "systemctl start httpd.service", the client libraries do NOT load. If I start apache with "apachectl start" the client libraries load, and applications run fine. This also seems to mean that the client libraries do NOT load at boot time, and therefore requires manual intervention. Any explanation/help to configure this would be greatly appreciated!
(09 Jul '12, 16:23)
tomb
Replies hidden
'apachectl' handles environment variables differently for Apache - it additionally reads the Apache 'envvars' config file (see the discussion here). How did you create the Apache service originally, or is this an RPM distribution? If you compiled from source, you can use 'chkconfig' to install the service. (See: here and here).
(10 Jul '12, 11:33)
Jeff Albion
|
I just added env[LD_LIBRARY_PATH] = /opt/sqlanywhere12/lib64 To my php-fpm.conf file. |