on 2012 Jul 05 3:50 PM
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!
Request clarification before answering.
Just finished Fedora16 install on virtual machine and did some digging around system configuration.
The file /etc/init.d/httpd
(main apache service file) sources
/etc/rc.d/init.d/functions
(common useful functions for daemons and
stuff). It tests if systemctl
should be used and then redirects
command (e.g. start) and service name (e.g. httpd) to systemctl
binary. This binary somehow fails to correctly source
/etc/sysconfig/httpd
and thus does not have correct PATH and
LD_LIBRARY_PATH
(not sure why...)
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
chmod a+x
it. Also you have to edit
/lib/systemd/system/httpd.service
file to point to this new custom
starter file. Back up it and replace line ExecStart=...
with this:
ExecStart=/usr/sbin/my-httpd
Restart httpd.service (via systemctl) and hopefully it should work now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just added env[LD_LIBRARY_PATH] = /opt/sqlanywhere12/lib64
To my php-fpm.conf file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's php-5.3.2_sqlanywhere.so
module complaining about not being able to find libraries.
$LD_LIBRARY_PATH
(as visible to apache) should contain also sasql12 libraries directory. In /etc/sysconfig/httpd
(I guess it's the right one in Fedora) add something like this:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sqlanywhere12/lib64
Check after apache restart your phpinfo()
for LD_LIBRARY_PATH
in Environment section to be sure sqlanywhere library directory is included.
HTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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!!
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!
'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).
User | Count |
---|---|
52 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.