[unixODBC-support] Problems usinf unixOdbc with php5 andPervasiveSQL Driver

Emiliano Romero eromero at sitrack.com
Mon Nov 12 12:13:08 GMT 2007


Hi!, you should have a "PHP Variables" and a _ENV['LD_LIBRARY_PATH']... if
you don’t, then php is not seeing the LD_LIBRARY_PATH environment var. Like
I said in the last mail, you should try putting the env variable in your
/etc/init.d/apache2 file... in the first part. I paste you a part of my
init.d file...

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

export PATH=$PATH:/opt/informix/bin;
export INFORMIXSERVER=stknm;
export INFORMIXDIR=/opt/informix;
export
LD_LIBRARY_PATH=/opt/oracle/instantclient_10_2/sdk/lib:/opt/informix/lib/esq
l/;

I have the same problem as you, after some days I solve the problem with
this, any way I'm not using unixODBC because it give's me a Segmentation
Fault in apache when I use Connection Pooling.

After doing this, remember you have to restart your apache and in info
should appear 
"_ENV["LD_LIBRARY_PATH"]:/usr/lib/oracle/10.2.0.3/client/lib:/opt/informix/l
ib/esql "

Hope this helps.

Regards


-----Mensaje original-----
De: unixodbc-support-bounces at easysoft.com
[mailto:unixodbc-support-bounces at easysoft.com] En nombre de Glyn Astill
Enviado el: Sábado, 10 de Noviembre de 2007 09:03 a.m.
Para: Support for the unixODBC project
Asunto: RE: [unixODBC-support] Problems usinf unixOdbc with php5
andPervasiveSQL Driver

Hi All,

I did as nick said and tried the isql command and it worked, so
unixODBC is working.

However its still not from php. I do have the LD_LIBRARY_PATH set in
the profile for the www-data user.

phpinfo shows the following in the odbc section though:

Active Persistent Links 	0
Active Links 	0
ODBC library 	unixODBC
ODBC_INCLUDE 	-I/usr/include
ODBC_LFLAGS 	-L/usr/lib
ODBC_LIBS 	-lodbc

However I don't seem to see any env vars outputted there?

Cheers people.
Glyn

--- Emiliano Romero <eromero at sitrack.com> wrote:

> 
> Hi!, You should add "/usr/local/psql/lib/" to the LD_LIBRARY_PATH.
> 
> Try this:
> # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/psql/lib/
> 
> If this still don't work, you should see file permission of that
> lib.
> 
> Another thing, you also should try putting:
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/psql/lib/
> in your apache init.d script (/etc/init.d/apache2).
> 
> If nothing of this works, make an script with:
> <?php phpinfo(); ?>
> 
> And send the output for ENV variable LD_LIBRARY_PATH.
> 
> Regards
> 
> -----Mensaje original-----
> De: unixodbc-support-bounces at easysoft.com
> [mailto:unixodbc-support-bounces at easysoft.com] En nombre de Glyn
> Astill
> Enviado el: Viernes, 09 de Noviembre de 2007 12:39 p.m.
> Para: unixodbc-support at easysoft.com
> Asunto: [unixODBC-support] Problems usinf unixOdbc with php5 and
> PervasiveSQL Driver
> 
> Hi People,
> 
> I'm new to this list so hello.
> 
> I'm trying to get unixODbc working with a driver for Pervasive SQL
> from php5 however I'm receiving the following error from php when I
> try to connect:
> 
> -----------------
> Warning: odbc_connect() [function.odbc-connect]: SQL error:
> [unixODBC][Driver Manager]Can't open lib
> '/usr/local/psql/lib/odbcci.so' : libpscore2.so.2: cannot open
> shared
> object file: No such file or directory, SQL state 01000 in
> SQLConnect
> in /var/php/pvsql_test.inc.php on line 7
> -----------------
> 
> I assume this is something to do with a library not being there, or
> not being set up properly.
> 
> After installing the Pervasive SQL driver I added the env vars
> reconmended in Pervasives docs to my default profile and they seem
> to
> be ther if I do a "set" in the terminal.
> 
> One of the variables was:
> "LD_LIBRARY_PATH=$PVSW_ROOT/lib:$PVSW_ROOT/bin:/usr/lib ; export
> LD_LIBRARY_PATH" which I presume may be important here.
> 
> a "ldd /usr/local/psql/lib/odbcci.so" shows the following:
> 
>         linux-gate.so.1 =>  (0xffffe000)
>         libpscore2.so.2 => /usr/local/psql/lib/libpscore2.so.2
> (0xb7df2000)
>         libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7dc4000)
>         libuuid.so.1 => /lib/libuuid.so.1 (0xb7dc1000)
>         libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0
> (0xb7daf000)
>         libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7dab000)
>         libgcc_s.so.1 => /usr/local/psql/lib/libgcc_s.so.1
> (0xb7da0000)
>         libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7c6e000)
>         /lib/ld-linux.so.2 (0x80000000)
> 
> And if I do a "strace isql dsn 2>st.log" I get quite a lot of
> errors
> in the st.log, I've attached it as it's quite big.
> 
> I'm new to odbc with linux (on debian etch btw) so I may have
> missed
> something really dumb.
> 
> Any help would be appreciated.
> Regards
> Glyn
> 
> 
> 
> 
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the
> answer. Try it
> now.
> http://uk.answers.yahoo.com/ 
> 
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.15.26/1120 - Release Date:
> 09/11/2007
> 09:26 a.m.
> 
> 
> 
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information.
> If you have received it in error, please notify the sender
> immediately and delete the original. Any other use of the email by
> you is prohibited.
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 



      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good
http://uk.promotions.yahoo.com/forgood/environment.html
_______________________________________________
unixODBC-support mailing list
unixODBC-support at easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-support


-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.30/1125 - Release Date: 11/11/2007
09:50 p.m.



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.
If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.



More information about the unixODBC-support mailing list