problem accessing a database via ODBC and PHP 3
| From: | Marie-Laure Miniussi | Date: | Mon, 23 Aug 1999 14:40:43 +0000 |
| Subject: | problem accessing a database via ODBC and PHP 3 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10101@lists.php.net to get a copy of this message | ||
Hello,
I'm using php-3.0.12, libiodbc-2.50.3 and apache_1.3.6 on a redhat 5.2.
I tried to use php with postgreSQL -> no problem.
But I have problems to access a Microsoft SQL server on a NT host via odbc.
I get the message 'Document Contains No Data', so as say the FAQ, here is
the resulting backtrace.
[root@coriolis php-3.0.12]# gdb /usr/local/apache_1.3.6/bin/httpd
GNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) run -X -f /usr/local/apache_1.3.6/conf/httpd.conf
Starting program: /usr/local/apache_1.3.6/bin/httpd -X -f
/usr/local/apache_1.3.6/conf/httpd.conf
[Mon Aug 23 16:27:22 1999] [warn] NameVirtualHost proxy.sophia.cnrs.fr:80 has no
VirtualHosts
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x400f8489 in _IO_vfprintf (s=0xbf800650, format=0x4005c435 "%s/.odbc.ini",
ap=0xbf8006d0) at vfprintf.c:192
vfprintf.c:192: No such file or directory.
(gdb) bt
#0 0x400f8489 in _IO_vfprintf (s=0xbf800650,
format=0x4005c435 "%s/.odbc.ini", ap=0xbf8006d0) at vfprintf.c:192
#1 0x40104083 in _IO_vsprintf (string=0xbf800728 "",
format=0x4005c435 "%s/.odbc.ini", args=0xbf8006d0) at iovsprintf.c:48
#2 0x400ff321 in sprintf (s=0xbf800728 "", format=0x4005c435 "%s/.odbc.ini")
at sprintf.c:33
#3 0x40058fbd in _iodbcdm_getinifile (buf=0xbf800728 "", size=1024)
at misc.c:182
#4 0x400590eb in _iodbcdm_getkeyvalbydsn (dsn=0x81488e0 "DR20", dsnlen=6,
keywd=0x4005abbc "TraceFile", value=0xbf80137c "", size=256) at misc.c:259
#5 0x400541c8 in _iodbcdm_settracing (hdbc=0x8477d50, dsn=0x81488e0 "DR20",
dsnlen=-3) at connect.c:565
#6 0x4005443e in SQLConnect (hdbc=0x8477d50, szDSN=0x81488e0 "DR20",
cbDSN=-3, szUID=0x80d3eae "", cbUID=-3, szAuthStr=0x80d3eae "",
cbAuthStr=-3) at connect.c:661
#7 0x400545f9 in SQLConnect (hdbc=0x8477b98, szDSN=0x81488e0 "DR20",
cbDSN=-3, szUID=0x80d3eae "", cbUID=-3, szAuthStr=0x80d3eae "",
cbAuthStr=-3) at connect.c:710
#8 0x400545f9 in SQLConnect (hdbc=0x84779e0, szDSN=0x81488e0 "DR20",
cbDSN=-3, szUID=0x80d3eae "", cbUID=-3, szAuthStr=0x80d3eae "",
cbAuthStr=-3) at connect.c:710
#9 0x400545f9 in SQLConnect (hdbc=0x8477828, szDSN=0x81488e0 "DR20",
cbDSN=-3, szUID=0x80d3eae "", cbUID=-3, szAuthStr=0x80d3eae "",
etc....etc....etc... more than 2000 hits like this one.
I thinked that the problem was that it didn't find the .odbc.ini, but there is
one for the http user. There is also a /etc/odbc.ini and
/usr/local/etc/odbc.ini.
So what have I done wrong?
I apologize if this is a trivial problem (I think it is but I can't find the
answer alone).
Thanks in advance
--
Marie-Laure Miniussi
Administrateur reseau du campus de Sophia-Antipolis
Tel: 04 93 95 42 52 - Fax: 04 92 96 03 39