Error ODBC Connection via PHP (solved)

Andreas Beier

New Member
Hi,

I am currently working on a ODBC connection via PHP to an OpenEdge. Well I actually gave up. I don't get it working.

I am testing the connection fresh installed system:

Linux debian 3.2.0-4-686-pae #1 SMP Debian 3.2.60-1+deb7u3 i686
Apache Version Apache/2.2.22 (Debian)
PHP Version 5.4.4-14+deb7u12

I do have installed the Linux ODBC-Client (OE SQL Networking)

root@debian:~# proenv
DLC: /usr/dlc
WRKDIR: /usr/wrk
OEM: /usr/oemgmt
OEMWRKDIR: /usr/wrk_oemgmt

Inserting /usr/dlc/bin to beginning of path and
setting the current directory to /usr/wrk.

OpenEdge Release 11.3 as of Wed Jul 17 16:45:17 EDT 2013

Mine PHP Source Code:

<?php

putenv ("ODBCINI=/usr/dlc/odbc/odbc.ini");
putenv ("ODBCINST=/usr/dlc/odbc/odbcinst.ini");
putenv ('LD_LIBRARY_PATH=/usr/dlc/odbc/lib');

$strSql =" SELECT * FROM PUB.S_Mitarbeiter; ";

if ( $con01 = odbc_connect ( 'Progress', 'ODBC_READ', 'XXXXXX', SQL_CUR_USE_ODBC ) ) {
echo 'Connection to DSN successful.';
$result = odbc_exec ( $con01, $strSql);
odbc_close($con01);
} else {
echo 'Connection to DSN not successful.';
}
?>

Mine odbc.ini:


[ODBC Data Sources]
Progress=Progress_SQL92_Driver

[Progress]
Driver=/usr/dlc/odbc/lib/pgoe27.so
;Driver=Progress
DatabaseName=pavar
PortNumber=13010
HostName=192.168.50.244
LogonID=odbc_read
Password=XXXXXX
APILevel=1
ConnectFunctions=YYN
CPTimeout=60
DriverODBCVer=04.10
FileUsage=0
SQLLevel=0
UsageCount=1
ArraySize=50
DefaultLongDataBuffLen=2048
DefaultIsolationLevel=1
StaticCursorLongColBuffLen=4096
Trace=1
Tracefile=/var/log/trace.out
TraceDll=/usr/dlc/odbc/lib/pgtrac27.so

Mine odbcinst.ini

[ODBC Drivers]
Progress=Installed
[Progress]
Driver=/usr/dlc/odbc/lib/pgoe27.so


While I do get a successful ODBC connection on odbc_connect (), as soon as try to odbc_exec () something, I get an segmentation fault error:

[Wed Aug 13 11:16:12 2014] [notice] child pid 2452 exit signal Segmentation fault (11)

A Segmentation Fault message would some times be displayed. This is usually indicative of an invalid odbc.ini or odbcinst.ini files. Check the files for correct locations of driver files, drivers used.
If everything appears correct, and still errors occur, contact Progress Support.


I have no idea what else I could change in the ODBC files. Can you maybe help?

Thanks
Andreas


P.S. The ODBC queries via the Windows driver in Excel are working. Slow, but working.
 
Last edited:

RealHeavyDude

Well-Known Member
AFAIK Progress does not support Debian Linux and maybe that is the reason why the ODBC driver fails there. But that is just a wild guess.

Heavy Regards, RealHeavyDude.
 

Andreas Beier

New Member
hey, I just came back from holiday.

I'll try to install CentOS tomorrow. If this fails, Ill try the RHEL Entry Level Server.

Ill keep you updated.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
6.1 is just the certification platform, but anything in 6.x is supported. They don't individually certify each point release.
 

Andreas Beier

New Member
I just found this link.
http://knowledgebase.progress.com/articles/Article/000027930?q=27930&l=en_US&fs=Search&pn=1

I just reinstalled CentOS 6.5 (i386) with this instruction and it works!!!!

The key: "During installation, when prompted to copy scripts in the path (/usr/bin) do not do so."

It might need some tweeking, but I am pretty positive now!

Thanks for all your help so far.

Things I am still working on: While ODBC is not the fastest client, is there any better way to access the DB via PHP? Any hints here for me?
 
Last edited:

TomBascom

Curmudgeon
You could use an app server -- that way you would have complete control over the data access from 4gl code. You should open a new thread for that discussion.

On the other hand... performance problems with ODBC could also be just because nobody has ever tuned the db for SQL connections. That is also a topic of it's own so you should open a new thread. You might want to research "UPDATE STATISTICS" before you do so.
 
Top