Hello,
OS: CentOS
Linux 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686 i686 i386 GNU/Linux
OpenEdge:
Progress OpenEdge Release 11.5 build 1114 on Linux
32 bit
PHP: 5.3.3
When attempting to connect to the database from PHP this program does not work:
<?PHP $dsn = "Progress"; putenv("LD_LIBRARY_PATH=/usr/dlc/odbc/lib:/usr/dlc/lib"); putenv("ODBCINI=/etc/odbc.ini"); Print "Test ODBC Progress <br>"; $sql="SELECT * FROM PUB.Customer"; if ($conn_id=odbc_connect("Progress","sysprogress","123", SQL_CUR_USE_ODBC)){ echo "connected to DSN: $dsn <br>"; if($result=odbc_do($conn_id, $sql)) { echo "executing '$sql'"; echo " Results: "; odbc_result_all($result, "BGCOLOR='#AAFFAA' border=3 width=30% bordercolordark='#FF0000'"); echo "freeing result"; odbc_free_result($result); }else{ echo "can not execute '$sql' "; } echo " closing connection $conn_id"; odbc_close($conn_id); }else{ echo " can not connect to DSN: $dsn "; } ?>
But it works on the OpenEdge 10.2B.
I checked the session by the debugger and I see:
gdb httpd /tmp/core.24452
...
Core was generated by `/usr/sbin/httpd'. Program terminated with signal 11, Segmentation fault. #0 0x01174c89 in SQLGetInfoW () from /usr/dlc/odbc/lib/pgoe27.so
Has anyone had the same error in OpenEdge 11.5?
How can I fix it?
Since it worked with the ODBC sample you need to try with PHP 5.6. Maybe DataDirect *fixed* a bug from pgoe23 to pgoe27.
Again, we hit a similar bug so we directly downloaded the distribution from Zend and not php. IIRC the PHP bug was introduced in 5.5 (no bug in 5.3) where if the first field in the SELECT was CHAR then it treated all the fields as CHAR, so you couldn't do something like "SELECT fChar, fChar, fInt FROM ..."
Hello,
OS: CentOS
Linux 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686 i686 i386 GNU/Linux
OpenEdge:
Progress OpenEdge Release 11.5 build 1114 on Linux
PHP: 5.3.3
When attempting to connect to the database from PHP this program does not work:
<?PHP
$dsn = "Progress";
putenv("LD_LIBRARY_PATH=/usr/dlc/odbc/lib:/usr/dlc/lib");
putenv("ODBCINI=/etc/odbc.ini");
Print "Test ODBC Progress <br>";
$sql="SELECT * FROM PUB.Customer";
if ($conn_id=odbc_connect("Progress","sysprogress","123", SQL_CUR_USE_ODBC)){
echo "connected to DSN: $dsn <br>";
if($result=odbc_do($conn_id, $sql)) {
echo "executing '$sql'";
echo " Results: ";
odbc_result_all($result, "BGCOLOR='#AAFFAA' border=3 width=30% bordercolordark='#FF0000'");
echo "freeing result";
odbc_free_result($result);
}else{
echo "can not execute '$sql' ";
}
echo " closing connection $conn_id";
odbc_close($conn_id);
}else{
echo " can not connect to DSN: $dsn ";
}
?>
But it works on the OpenEdge 10.2B.
I checked the session by the debugger and I see:
gdb httpd /tmp/core.24452
...
Core was generated by `/usr/sbin/httpd'.
Program terminated with signal 11, Segmentation fault.
#0 0x01174c89 in SQLGetInfoW () from /usr/dlc/odbc/lib/pgoe27.so
Has anyone had the same error in OpenEdge 11.5?
How can I fix it?
Flag this post as spam/abuse.
A few points:
1. pgoe27.so is there since 10.2B08. Before that it was pgoe1023.so. Can you confirm which pgoe you were using before?
2. I had a similar issue going from PHP 5.3.3 to 5.5/5.6 and it turned out to be a PHP bug. We downloaded the Zend distribution of PHP and the problem went away.
3. Progress ships with an example ODBC program in $DLC/odbc/samples/example. Try the same ODBC query using the example code. If it works then it's probably a PHP issue.
[quote user="Paul Koufalis"]
1. pgoe27.so is there since 10.2B08. Before that it was pgoe1023.so. Can you confirm which pgoe you were using before?
[/quote]
Version of OpenEdge where test.php worked is 10.2B without SP. Yes, it use pgoe1023.so.
[quote user="Paul Koufalis"]
2. I had a similar issue going from PHP 5.3.3 to 5.5/5.6 and it turned out to be a PHP bug. We downloaded the Zend distribution of PHP and the problem went away.
[/quote]
It's weird for me because OpenEdge 10.2B and OpenEdge 11.5 Installing on the same machine.
Thus there all the same including PHP version. The differences only in OpenEdge versions.
[quote user="Paul Koufalis"]
3. Progress ships with an example ODBC program in $DLC/odbc/samples/example. Try the same ODBC query using the example code. If it works then it's probably a PHP issue.
Hm... it works. It also works through isql. But this still strange for me and not understandable why with OE10.2B (no SP) PHP works, but with OE 11.5 with the same PHP it not work (?!?)
Additional info.
With pgoe1023.so (from 10.2B) and OpenEdge 11.5 database connection is successful. So I think that problem in ODBC, namely in pgoe27.so
Since it worked with the ODBC sample you need to try with PHP 5.6. Maybe DataDirect *fixed* a bug from pgoe23 to pgoe27.
Again, we hit a similar bug so we directly downloaded the distribution from Zend and not php. IIRC the PHP bug was introduced in 5.5 (no bug in 5.3) where if the first field in the SELECT was CHAR then it treated all the fields as CHAR, so you couldn't do something like "SELECT fChar, fChar, fInt FROM ..."
Ok. I'll look in that direction. Thank you!