Question

I have installed the Pervasive v10 linux 32 bit ODBC client (64 bit is not available) on Centos 6.2 64 bit. I can successfully use isql to connect to a remote data source. However, when attempting to connect via PHP with:

$connect = odbc_connect("demodata", "", "");

I get the same error isql gave me before I got my environment variables correct.

Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/usr/local/psql/lib/odbcci.so' : file not found, SQL state 01000 in SQLConnect in /var/www/html/pst.php on line 2

I've tried adding the env variables to /etc/sysconfig/httpd:

export PVSW_ROOT=/usr/local/psql
export PATH=$PVSW_ROOT/bin:/bin:/usr/bin
export LD_LIBRARY_PATH=$PVSW_ROOT/lib:$PVSW_ROOT/lib64:$PVSW_ROOT/bin:/usr/lib
export MANPATH=$PVSW_ROOT/man:$MANPATH
export BREQ=$PVSW_ROOT/lib
export LD_BIND_NOW=1

I've added apache to the pvsw group

/usr/bin/gpasswd -a apache pvsw

Was it helpful?

Solution

My guess is that Apache and PHP are running as a 64 bit process and can't load the 32 bit ODBC drivers. I ran a quick install of CentOS 6.2 x64 and installed the default Apache and PHP and saw that it was a 64 bit version. In a phpinfo page, I see "2.6.32-220.el6.x86_64" in the System portion.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top