I've tried this with both PHP4.0.4 and PHP4.0.4pl1 as a module (it's for a
daily script eventually).

[root=pts/1]7:29pm@content:{/www/html/private/TattooShop}>
./odbc-test2.phtml
#!/bin/php -q
Segmentation fault

the relevant part of phpinfo(); is below, so I'm assuming that I finally got
odbc compiled into it:

        Configure Command './configure' '--with-iodbc=/usr/local/openlink/odbcsdk'
'--with-mysql=/usr/local' '--with-config-file-path=/etc'
        ODBC
        ODBC library                    iodbc
        odbc.allow_persistent           On
        odbc.check_persistent           On
        odbc.default_db                 no value
        odbc.default_pw
        odbc.default_user                       no value
        odbc.defaultbinmode             return as is
        odbc.defaultlrl                 return up to 4096 bytes
        odbc.max_links                  Unlimited
        odbc.max_persistent             Unlimited


here is the actual "odbc-test2.phtml" script, which is basically the one in
the iODBC PHP install example:
Commented lines are one's I've tried too with the same or worse results.
Commenting out the odbc_* line(s) doesn't segfault, but then again, it's a
useless script at that point too ;-)
----------------------
#!/bin/php -q
<?php
//phpinfo();

//putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib");
putenv("LD_LIBRARY_PATH=/usr/local/openlink/lib");
putenv("ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini");
putenv("ODBCINI=/usr/local/openlink/bin/odbc.ini");
$dsn="DSN=OpenLink"; // this is a valid DSN set up in the above odbc.ini
file
$user="daevid"; //default user for the demo database
$password="secret"; //default password for demo database

$sql="SELECT * FROM EMP";

$conn_id = odbc_pconnect("$dsn","$user","$password");
//$conn_id = odbc_connect("$dsn","$user","$password");
//$conn_id = odbc_connect("$dsn","","");
//$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","","");
?>
----------------------

and here is the directory structure:
[root=pts/2]7:33pm@content:{/usr/src/WT_Apache_Setup/php}> l
/usr/local/openlink/odbcsdk/lib
total 976
-rw-r--r--    1 openlink openlink   143692 Mar  7 14:42 libiodbc.a
-rwxr-xr-x    1 openlink openlink      669 Mar  7 14:42 libiodbc.la*
lrwxrwxrwx    1 openlink openlink       17 Mar 30 15:16 libiodbc.so ->
libiodbc.so.2.1.2*
lrwxrwxrwx    1 openlink openlink       17 Mar 30 15:16 libiodbc.so.2 ->
libiodbc.so.2.1.2*
-rwxr-xr-x    1 openlink openlink   117877 Mar  7 14:42 libiodbc.so.2.1.2*
-rw-r--r--    1 openlink openlink   431992 Mar  7 14:42 oplodbc.a
-rw-r--r--    1 openlink openlink      678 Mar  7 14:42 oplodbc.la
lrwxrwxrwx    1 openlink openlink       16 Mar 30 15:16 oplodbc.so ->
oplodbc.so.1.0.0
lrwxrwxrwx    1 openlink openlink       16 Mar 30 15:16 oplodbc.so.1 ->
oplodbc.so.1.0.0
-rw-r--r--    1 openlink openlink   272057 Mar  7 14:42 oplodbc.so.1.0.0
[root=pts/2]7:33pm@content:{/usr/src/WT_Apache_Setup/php}> l
/usr/local/openlink/lib
total 400
-rwxr-xr-x    1 openlink openlink      669 Mar  7 14:43 libiodbc.la*
lrwxrwxrwx    1 openlink openlink       17 Mar 30 15:16 libiodbc.so ->
libiodbc.so.2.1.2*
lrwxrwxrwx    1 openlink openlink       17 Mar 30 15:16 libiodbc.so.2 ->
libiodbc.so.2.1.2*
-rwxr-xr-x    1 openlink openlink   117877 Mar  7 14:43 libiodbc.so.2.1.2*
lrwxrwxrwx    1 openlink openlink       17 Mar 30 15:16 libodbc.so ->
libiodbc.so.2.1.2*
-rw-r--r--    1 openlink openlink      678 Mar  7 14:43 oplodbc.la
lrwxrwxrwx    1 openlink openlink       16 Mar 30 15:16 oplodbc.so ->
oplodbc.so.1.0.0
lrwxrwxrwx    1 openlink openlink       16 Mar 30 15:16 oplodbc.so.1 ->
oplodbc.so.1.0.0
-rw-r--r--    1 openlink openlink   272057 Mar  7 14:43 oplodbc.so.1.0.0
[root=pts/2]7:33pm@content:{/usr/src/WT_Apache_Setup/php}> l
/usr/local/openlink/bin/
total 136
-rwxr--r--    1 openlink openlink    23260 Mar  7 14:43 inifile*
-rw-rw-rw-    1 openlink openlink      521 Apr  2 18:15 odbc.ini
-rw-r--r--    1 openlink openlink      473 Mar  7 14:43 odbc.ini.sample
-rw-rw-rw-    1 openlink openlink      180 Mar 29 20:21 odbcinst.ini
-rw-r--r--    1 openlink openlink      170 Mar  7 14:43 odbcinst.ini.sample
-rwxr-xr-x    1 openlink openlink    92225 Mar  7 14:43 odbctest*
-rw-rw-rw-    1 openlink openlink        0 Mar 29 20:20 oplrqb.ini

here is some other useful info:

[root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> cat odbc.ini
        [ODBC Data Sources]
        OpenLink       = OpenLink Generic ODBC Driver

        [OpenLink]
        Driver          = /usr/local/openlink/lib/oplodbc.so.1
        Description     = Sample OpenLink DSN
        Host            = 10.2.3.11
        ServerType      = Oracle 8.1.x
        FetchBufferSize = 99
        UserName        = daevid
        Password        = secret
        Database        = mydatabase
        ServerOptions   =
        ConnectOptions  =
        Options         =
        ReadOnly        = yes
        Trace           = 0
        TraceFile       = /tmp/iodbc.trace

        [Default]
        Driver = /usr/local/openlink/lib/oplodbc.so.1

Is "ServerType = Oracle 8.1.x" right?
I'm trying to connect to a MS SQL2000 server on a Win2k box:

[root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> cat odbcinst.ini
        [ODBC Drivers]
        OpenLink Generic ODBC Driver = Installed

        [OpenLink Generic ODBC Driver]
        Driver = /usr/local/openlink/lib/oplodbc.so.1
        Setup  = /usr/local/openlink/lib/oplodbc.so.1

[root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> ./odbctest
OpenLink ODBC Demonstration program
This program shows an interactive SQL processor

Enter ODBC connect string (? shows list): ?

DSN                            | Description
---------------------------------------------------------------
OpenLink                       | OpenLink (MT)

Enter ODBC connect string (? shows list): OpenLink
[iODBC][Driver Manager]Dialog failed, SQLSTATE=IM008

Have a nice day.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to