Edit report at http://bugs.php.net/bug.php?id=51877&edit=1
ID: 51877
Updated by: pajoye@php.net
Reported by: diegoturriaga at yahoo dot com dot ar
Summary: php5ts.dll crash and reset Apache
-Status: Open
+Status: Feedback
Type: Bug
Package: Reproducible crash
Operating System: Windows XP / 2003
PHP Version: 5.3.2
New Comment:
Well, not sure I can even debug that as I see no way to have the VFP
data.
But why do you use COM and ADODB instead of ODBC? ODBC will be way more
stable than ADODB through COM.
Previous Comments:
------------------------------------------------------------------------
[2010-05-21 20:14:33] diegoturriaga at yahoo dot com dot ar
<?php
$charPage = CP_UTF8;
$stringDeConexion = 'Provider=VFPOLEDB.1;Data
Source="\\server\data";Mode=ReadWrite|Share Deny
None;Password="";Collating Sequence=SPANISH;DELETED=False';
$cantRegAfectados = -1;
$consulta = 'SELECT * FROM hugedbf1 x INNER JOIN hugedbf2 y ON
x.Id=y.xId';
$conexion = null;
$rs = null;
$comando = null;
# intenta crear el objeto y conectarse
try {
$conexion = new COM("ADODB.Connection", null, $charPage);
$conexion->ConnectionTimeout = 1200;
$conexion->CommandTimeout = 2400;
$conexion->Open($stringDeConexion);
}
catch (Exception $e) {
echo "Error creando conexion OLEDB.<br/><br/>". $e->getMessage();
exit(1);
}
# intenta crear un comando
try {
$comando = new COM("ADODB.Command");
$comando->CommandType = 1; //adCmdText
$comando->ActiveConnection = $conexion;
$comando->CommandText = $consulta;
}
catch (Exception $e) {
echo "Error creando el comando OLEDB.<br/><br/>". $e->getMessage();
exit(1);
}
# intenta ejecutar el comando SQL
try {
$rs = $comando->Execute($cantRegAfectados);
}
catch (Exception $e) {
echo "Error ejecutando comando OLEDB.<br/><br/>". $e->getMessage();
exit(1);
}
# pasa los datos al recordset y libera los recursos
$this->recordset = array();
$j=0;
if ($rs->State!=0) {
while (!$rs->EOF) {
for ($i=0; $i<$rs->Fields()->Count; $i++) {
$this->recordset[$j][$rs[$i]->Name] = $rs[$i]->Value;
}
$rs->MoveNext();
$j++;
}
$rs->Close();
}
$conexion->Close();
$rs = null;
$conexion = null;
echo "It's all right!";
return 0;
?>
PD: You will need hugedbf1.dbf and hugedbf2.dbf shared on \\server\data
and the user running apache service need permission from I/O there.
Also
you have to have installed the VFP OLEDB drivers.
------------------------------------------------------------------------
[2010-05-21 11:15:24] pajoye@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2010-05-21 01:43:31] diegoturriaga at yahoo dot com dot ar
Description:
------------
I thought it might be a matter of server version so initially I started
a report here (http://www.apachelounge.com/viewtopic.php?p=15696) which
will be of help to avoid writing both.
Test script:
---------------
In the previous url I have posted some php code... You can use a
connection string like this for testing:
$cnStr = 'Provider=VFPOLEDB.1;Data
Source="\\server\data";Mode=ReadWrite|Share Deny
None;Password="";Collating Sequence=SPANISH;DELETED=False';
Other variables needed:
$charPage = CP_UTF8;
$consulta = "SELECT * FROM hugedbf1 x INNER JOIN hugedbf2 y ON
x.Id=y.xId"
And it's all... works fine for a few records but crash for many.
As I said in the other post, works fine with PHP 5.2
Expected result:
----------------
array results
Actual result:
--------------
php5ts.dll crash
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51877&edit=1