|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-10-31 09:22 UTC] kalowsky@php.net
[2003-10-31 11:02 UTC] miroslav dot sulc at startnet dot cz
[2003-12-09 11:18 UTC] sirb3r at yahoo dot ca
[2012-02-09 07:58 UTC] saketisthere at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
Description: ------------ I cannot connect with: $var=odbc_connect('myodbc-test','root','password'); to my MyODBC data source. Here is the error: Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/usr/lib/libmyodbc3.so' : unknown error, SQL state IM003 in SQLConnect in /home/httpd/bagr/docs/test.php on line 2 I would appreciate any help. Below is some more info. isql command work fine: echo "show tables; > " | isql myodbc-test root password +---------------------------------------+ | Connected! | | | | sql-command | | help [tablename] | | quit | | | +---------------------------------------+ SQL> +-----------------------------------------------------------------+ | Tables_in_test | +-----------------------------------------------------------------+ +-----------------------------------------------------------------+ 0 rows affected Here is PHP configuration: './configure' '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--without-readline' '--with-apxs2=/usr/sbin/apxs2' '--with-ndbm=/usr' '--with-db4=/usr' '--with-mcrypt=/usr' '--with-mhash=/usr' '--with-ming=/usr' '--with-swf=/usr' '--with-sybase=/usr' '--with-gdbm=/usr' '--with-java=/opt/blackdown-jdk-1.4.1' '--with-mcal=/usr' '--with-unixODBC=/usr' '--with-pgsql=/usr' '--with-snmp=/usr' '--enable-ucd-snmp-hack' '--with-pdflib=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-png' '--with-png-dir=/usr' '--with-jpeg' '--with-jpeg-dir=/usr' '--enable-exif' '--with-tiff' '--with-tiff-dir=/usr' '--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr' '--with-ttf=/usr' '--with-t1lib=/usr' '--with-gettext' '--without-qtdom' '--with-pspell=/usr' '--with-openssl=/usr' '--with-imap=/usr' '--with-ldap=/usr' '--with-dom=/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-kerberos=/usr' '--with-pam' '--disable-memory-limit' '--disable-ipv6' '--with-curlwrappers' '--with-curl=/usr' '--enable-dbx' '--with-imap-ssl' '--with-zlib' '--with-zlib-dir=/usr' '--with-sablot=/usr' '--enable-xslt' '--with-xslt-sablot' '--with-xmlrpc' '--enable-wddx' '--with-xml' '--enable-mbstring=all' '--enable-mbregex' '--with-bz2=/usr' '--with-crack=/usr' '--with-cdb' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-filepro' '--enable-ftp' '--with-mime-magic' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvipc' '--with-iconv' '--enable-shmop' '--enable-dio' '--enable-inline-optimization' '--enable-track-vars' '--enable-trans-sid' '--enable-versioning' '--with-config-file-path=/etc/php/apache2-php4' Here are versions: unixODBC: 2.0.6 MyODBC: 3.51.06 /etc/unixODBC/odbc.ini: [myodbc-test] Description = MySQL ODBC myodbc-3.51.06 Driver Testing DSN Driver = /usr/lib/libmyodbc3.so Socket = /var/run/mysqld/mysqld.sock Server = localhost User = root Database = test Option = 3 /etc/unixODBC/odbcinst.ini: [myodbc] Description = MySQL ODBC Driver Driver = /usr/lib/libmyodbc3.so FileUsage = 1 File permissions: ls -l /usr/lib/libmyodbc3* -rwxr-xr-x 1 root root 157984 Oct 30 10:28 /usr/lib/libmyodbc3-3.51.06.so -rw-r--r-- 1 root root 175340 Oct 30 10:28 /usr/lib/libmyodbc3.a -rwxr-xr-x 1 root root 861 Oct 30 10:28 /usr/lib/libmyodbc3.la lrwxrwxrwx 1 root root 21 Oct 30 10:28 /usr/lib/libmyodbc3.so -> libmyodbc3-3.51.06.so Apache runs as user apache and group apache. php.ini diff against unpacked php.ini-dist from src distribution. diff /etc/php/apache2-php4/php.ini php-4.3.3/php.ini-dist 428c428 < extension_dir = /usr/lib/php/extensions/no-debug-non-zts-20020429 --- > extension_dir = "./" 490,492c490 < ; allow_url_fopen = On < ; Closed for security - <robbat2@gentoo.org> < allow_url_fopen = Off --- > allow_url_fopen = On 530c528 < ; extension_dir = /usr/lib/php/extensions/no-debug-non-zts-20020429 --- > ; extension_dir directive above. 556c554 < extension = java.so --- > ;extension=php_java.dll 603c601 < java.class.path = /usr/lib/php/extensions/no-debug-non-zts-20020429/php_java.jar --- > ;java.class.path = .\php_java.jar 605,606c603,604 < java.library = /opt/blackdown-jdk-1.4.1/jre/lib/i386/libjava.so < java.library.path = /usr/lib/php/extensions/no-debug-non-zts-20020429 --- > ;java.library = c:\jdk\jre\bin\hotspot\jvm.dll > ;java.library.path = .\ I hope it's enough. Reproduce code: --------------- $var=odbc_connect('myodbc-test','root','password'); Expected result: ---------------- Should connect without errors :-) Actual result: -------------- Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/usr/lib/libmyodbc3.so' : unknown error, SQL state IM003 in SQLConnect in /home/httpd/bagr/docs/test.php on line 2