php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51877 php5ts.dll crash and reset Apache
Submitted: 2010-05-21 01:43 UTC Modified: 2010-09-28 14:43 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
From: diegoturriaga at yahoo dot com dot ar Assigned:
Status: Open Package: Reproducible crash
PHP Version: 5.3.2 OS: Windows XP / 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: diegoturriaga at yahoo dot com dot ar
New email:
PHP Version: OS:

 

 [2010-05-21 01:43 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-21 11:15 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-05-21 11:15 UTC] 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 20:14 UTC] diegoturriaga at yahoo dot com dot ar
-Status: Feedback +Status: Open
 [2010-05-21 20:14 UTC] 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 20:17 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-05-21 20:17 UTC] pajoye@php.net
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.
 [2010-05-21 20:21 UTC] diegoturriaga at yahoo dot com dot ar
-Status: Feedback +Status: Open
 [2010-05-21 20:21 UTC] diegoturriaga at yahoo dot com dot ar
Ups! Please replace $this->recordset by $recordset (copy/paste error;)
 [2010-05-21 20:25 UTC] diegoturriaga at yahoo dot com dot ar
That speed! ODBC is slower, the driver is older and, especially, corrupts the index file (cdx) on deletes
 [2010-05-21 20:33 UTC] pajoye@php.net
If the odbc driver corrupts vfp index, then you should report a bug to Microsoft. I'm not sure we can fix your issue easily, so pls don't hold your breath :)
 [2010-05-21 20:33 UTC] diegoturriaga at yahoo dot com dot ar
If you have an xls file (dbf format) you can save it as DBASE IV file. (without a CDX index associated but functional)
 [2010-05-21 20:36 UTC] diegoturriaga at yahoo dot com dot ar
Microsoft no longer provides support for VFP, but the OLEDB driver works fine with PHP 5.2.13 so I guess it's a bug in version 5.3.x
 [2010-09-28 14:26 UTC] jakub dot gemrot at gmail dot com
Hi, try to copy libmysql.dll from the php dir into apache root, i.e., 

I have ApacheRoot=D:/Apache
and PHP5 inside D:/PHP5

I've copied
D:/PHP5/libmysql.dll

Into
D:/Apache/

And it works (for me).

php5ts.dll is probably searching for the dll and is unable to find it ... and crashes :-)

Cheers!
Jakub Gemrot
 [2010-09-28 14:28 UTC] jakub dot gemrot at gmail dot com
Well I did't quite read the problem ... I see that my problem was a little different ... php5ts.dll crashed every time I've tried to call mysql_connect.

Best, Jakub Gemrot
 [2010-09-28 14:43 UTC] pajoye@php.net
@jakub dot gemrot at gmail dot com

PHP 5.3+ on windows does not use libmysql.dll anymore.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Nov 19 13:01:26 2018 UTC