[PHP-DB] Re: [PHP] RE: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect

2001-04-03 Thread Andrew Hill

Daevid,

On Tuesday, April 3, 2001, at 08:31 PM, Daevid Vincent wrote:

> So close and yet so far away... is there an "odbcping" type program? If 
> we
> run "odbcping" on the SQL2000 server, it works fine (to itself of 
> course,
> but using the ODBC settings AFAIK).
>

yes, it's called odbctest. :)


> [root=pts/3]3:59pm@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 Generic ODBC Driver
> TattooReader   | Tattoo Database on SQL2000 server
>
> Enter ODBC connect string (? shows list): DSN=TattooReader
> select * from blah

does the select work?
>
> exit
>
> the only way to exit this is to kill the process, "exit" doesn't work.
> So, I'm not getting any errors anymore, but it's not doing anything 
> either.
ah, so I guess not.

> Now we haven't ruled out the firewall as a possible problem here, 
> however I
> can:
> [root=pts/3]3:59pm@content:{/usr/local/openlink/bin}> telnet 10.2.3.11 
> 1433
> Trying 10.2.3.11...
> Connected to 10.2.3.11.
> Escape character is '^]'.
> ^[
> ^[^[
> ^[^[^[
> ^[^[
> ^[
> ^[
>

Why are you trying the server tcp port 1433?  That is not one used by 
our Multi-Tier drivers.
Please verify that you have installed the server-side drivers.

If a firewall is in place on the SQLServer box, you can open it up for 
TCP 5000 to 5020 as a default range, or open whatever you want and 
change the PortHigh and PortLow directives in the oplrqb.ini file.

> but as you can see, ^] doesn't Escape. In fact, the only way to stop it 
> is
> to kill the telnet process from another shell. SHOULD I be able to do
> anything from the telnet prompt? Like with HTTP, you can get it to spew 
> out
> a web page, is there some command to run to make sure the connection is 
> all
> good in both directions?

I suppose that could be a firewall issue - dunno and it's not relevant 
to this issue.
>
> [root=pts/2]4:03pm@content:{/root}> netstat
> Active Internet connections (w/o servers)
> Proto Recv-Q Send-Q Local Address   Foreign Address 
> State
> tcp0  0 xxx.xxx.xxx.xxx:1096 10.2.3.11:1433
> ESTABLISHED
>
> notice that the ports don't line up. should they? my MIS guy says that's
> normal and there's just a pool of ports the OS picks from and will 'map'
> them correctly (in lay terms).

normal for your shell/terminal type, but again not relevant.

>
> and FWIW, the PHP example STILL segfaults. I would expect it to through 
> up
> an error, not segfault... that can't be good can it?
>
I'm wondering if you've compiled properly.
Can you pass me a phpinfo(); page? Off list is fine.

Best regards,
Andrew
---
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com


> daevid.com
>
>> -Original Message-
>> From: Andrew Hill [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, April 02, 2001 8:08 PM
>> To: Daevid Vincent; [EMAIL PROTECTED]; PHP General
>> Subject: Re: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect
>>
>>
>> Daevid,
>>
>>
>> connection script snipped (looked fine)
>>
>>> $dsn="DSN=OpenLink"; // this is a valid DSN set up in the above 
>>> odbc.ini
>>
>>> //$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","","");
>>> ?>
>>> --
>>>
>>> [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:
>>
>> No, that is just a sample DSN - you will want to edit it to match your
>> confi

RE: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect

2001-04-03 Thread Daevid Vincent

So close and yet so far away... is there an "odbcping" type program? If we
run "odbcping" on the SQL2000 server, it works fine (to itself of course,
but using the ODBC settings AFAIK).

[root=pts/1]2:08pm@content:{/usr/local/openlink/bin}> setenv
LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib
ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini
ODBCINI=/usr/local/openlink/bin/odbc.ini

[root=pts/1]2:08pm@content:{/usr/local/openlink/bin}> cat odbc.ini
[ODBC Data Sources]
OpenLink   = OpenLink Generic ODBC Driver
TattooReader   = Tattoo Database on SQL2000 server

[TattooReader]
Driver  = /usr/local/openlink/lib/oplodbc.so.1
Description = TattooReader
Host= 10.2.3.11
ServerType  = SQLServer 2000
FetchBufferSize = 99
UserName= Tattoo_reader
Password= a4w59
Database= wt_updater_checkin
ServerOptions   =
ConnectOptions  =
Options =
ReadOnly= yes
Trace   = 0
TraceFile   = /tmp/iodbc.trace

[OpenLink]
Driver  = /usr/local/openlink/lib/oplodbc.so.1
Description = Sample OpenLink DSN
Host= 10.2.3.11
ServerType  = SQLServer 2000
FetchBufferSize = 99
UserName= Tattoo_reader
Password= a4w59
Database= wt_updater_checkin
ServerOptions   =
ConnectOptions  =
Options =
ReadOnly= yes
Trace   = 0
TraceFile   = /tmp/iodbc.trace

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

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

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

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


[root=pts/3]3:59pm@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 Generic ODBC Driver
TattooReader   | Tattoo Database on SQL2000 server

Enter ODBC connect string (? shows list): DSN=TattooReader
select * from blah



exit

the only way to exit this is to kill the process, "exit" doesn't work.
So, I'm not getting any errors anymore, but it's not doing anything either.

Now we haven't ruled out the firewall as a possible problem here, however I
can:
[root=pts/3]3:59pm@content:{/usr/local/openlink/bin}> telnet 10.2.3.11 1433
Trying 10.2.3.11...
Connected to 10.2.3.11.
Escape character is '^]'.
^[
^[^[
^[^[^[
^[^[
^[
^[
but as you can see, ^] doesn't Escape. In fact, the only way to stop it is
to kill the telnet process from another shell. SHOULD I be able to do
anything from the telnet prompt? Like with HTTP, you can get it to spew out
a web page, is there some command to run to make sure the connection is all
good in both directions?

[root=pts/2]4:03pm@content:{/root}> netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address   Foreign Address State
tcp0  0 xxx.xxx.xxx.xxx:1096 10.2.3.11:1433
ESTABLISHED

notice that the ports don't line up. should they? my MIS guy says that's
normal and there's just a pool of ports the OS picks from and will 'map'
them correctly (in lay terms).

and FWIW, the PHP example STILL segfaults. I would expect it to through up
an error, not segfault... that can't be good can it?

daevid.com

> -Original Message-
> From: Andrew Hill [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 02, 2001 8:08 PM
> To: Daevid Vincent; [EMAIL PROTECTED]; PHP General
> Subject: Re: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect
>
>
> Daevid,
>
>
> connection script snipped (looked fine)
>
> > $dsn="DSN=OpenLink"; // this is a valid DSN set up in the above odbc.ini
>
> > //$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","","");
> > ?>
> > --
> >
> > [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
>

Re: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect

2001-04-02 Thread Andrew Hill

Daevid,


connection script snipped (looked fine)

> $dsn="DSN=OpenLink"; // this is a valid DSN set up in the above odbc.ini

> //$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","","");
> ?>
> --
> 
> [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:

No, that is just a sample DSN - you will want to edit it to match your
configureation or add an additional one wiht server type SQLServer 2000
Database is the sqlserver catalog, e.g. northwind, pubs, or yours.

When adding a DSN, add a matching section at the top as well:

[ODBC Data Sources]
OpenLink   = OpenLink Generic ODBC Driver //o
SQLServer2k

[SQLServer2k]
Driver  = /usr/local/openlink/lib/oplodbc.so.1
Host= 10.2.3.11
FetchBufferSize = 99
ServerType  = SQLServer2000
UserName= daevid
Password= secret
Database= mydatabase

You can add the other options as you see fit, or even override these by
setting the RulesBook on the server side.

Everything else looks fine.

This assumes you have the server-side components of our Multi-Tier driver
installed on the SQLServer box.  It might be wise to add a DSN on the server
using the OpenLink driver, to test you have the server-side components
installed properly.

If you've not yet installed them, the SQLServer agent / Request Broker
components are at: http://www.openlinksw.com/software/open40/ntadmzzz.zip

Checking the docs out for configuring OpenLink Drivers might not hurt
either, and might have saved you time setting up your initial connection:
http://www.openlinksw.com/info/docs/rel4doc/index.html
> 
> [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

Syntax problem here - odbctest takes the argument "DSN=DSN_Name", not just
the DSN_Name
> 
> Have a nice day.
> 

You obviously have the ODBCINI set properly in the environmnet, or odbctest
wouldn't show your DSNs.

So fix the ServerType, ensure working server-side components, and change
your connection syntax for odbctest - you actually are just about there.

Let me know if you need additional assistance.

Best regards,
Andrew
---
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com


-- 
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]




[PHP-DB] PHP4.0.4 segfaults with odbc_pconnect

2001-04-02 Thread Daevid Vincent

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 libraryiodbc
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

--

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-x1 openlink openlink  669 Mar  7 14:42 libiodbc.la*
lrwxrwxrwx1 openlink openlink   17 Mar 30 15:16 libiodbc.so ->
libiodbc.so.2.1.2*
lrwxrwxrwx1 openlink openlink   17 Mar 30 15:16 libiodbc.so.2 ->
libiodbc.so.2.1.2*
-rwxr-xr-x1 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
lrwxrwxrwx1 openlink openlink   16 Mar 30 15:16 oplodbc.so ->
oplodbc.so.1.0.0
lrwxrwxrwx1 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-x1 openlink openlink  669 Mar  7 14:43 libiodbc.la*
lrwxrwxrwx1 openlink openlink   17 Mar 30 15:16 libiodbc.so ->
libiodbc.so.2.1.2*
lrwxrwxrwx1 openlink openlink   17 Mar 30 15:16 libiodbc.so.2 ->
libiodbc.so.2.1.2*
-rwxr-xr-x1 openlink openlink   117877 Mar  7 14:43 libiodbc.so.2.1.2*
lrwxrwxrwx1 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
lrwxrwxrwx1 openlink openlink   16 Mar 30 15:16 oplodbc.so ->
oplodbc.so.1.0.0
lrwxrwxrwx1 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 openlink23260 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-x1 openlink openlink92225 Mar  7 14:43 odbctest*
-rw-rw-rw-1 openlink openlink0 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