Topic: php-odbc : Can't open cursor lib 'libodbccr'
[unixODBC][Driver Manager]Can't open cursor lib 'libodbccr' : file not found'
<?php
$cnx = new PDO("odbc:DRIVER=FreeTDS;SERVER=localhost,49503;DATABASE=DB;MARS_Connection=yes;", 'ereporting', 'CqPkYMLiUU5NBfPwnMFk');
Or tout fonctionne correctement sans passer par PHP (tsql et isql me permettent de me connecter).
Je pense que tu n'a pas buildé PHP ODBC avec la bonne version d'unixODBC.
En analysant un peu plus :
$ locate libodbccr
/usr/lib64/libodbccr.so.2
/usr/lib64/libodbccr.so.2.0.0
$ rpm -qf /usr/lib64/libodbccr.so.2
unixODBC-2.2.14-12.el6_3.x86_64
$ yum info unixODBC-2.2.14-12.el6_3.x86_64
Installed Packages
Name : unixODBC
Arch : x86_64
Version : 2.2.14
Release : 12.el6_3
Repo : installed
From repo : base
$ strace php monscript.php
...
access("/lib64/libodbccr.so.1", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib64/libodbccr.so.1", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/libodbccr.so.1", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/libodbccr.so.1", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=29142, ...}) = 0
mmap(NULL, 29142, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7fbdc5755000
close(5) = 0
open("/lib64/tls/x86_64/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls/x86_64", 0x7fff64b5ff90) = -1 ENOENT (No such file or directory)
open("/lib64/tls/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/lib64/x86_64/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/x86_64", 0x7fff64b5ff90) = -1 ENOENT (No such file or directory)
open("/lib64/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64", {st_mode=S_IFDIR|0555, st_size=12288, ...}) = 0
open("/usr/lib64/tls/x86_64/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls/x86_64", 0x7fff64b5ff90) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/tls", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/usr/lib64/x86_64/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/x86_64", 0x7fff64b5ff90) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib64", {st_mode=S_IFDIR|0555, st_size=20480, ...}) = 0
munmap(0x7fbdc5755000, 29142) = 0
open("/usr/lib64/libodbccr.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
close(4) = 0
brk(0x18d7000) = 0x18d7000
Si on cherche qui fournit libodbccr.so.1 on ne trouve qu'un paquet Centos 5.x :
http://rpmfind.net/linux/rpm2html/searc … rch=x86_64