ID: 21172 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: COM related Operating System: Windows 2000 PHP Version: 4.2.1 New Comment:
This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-01-08 20:36:48] [EMAIL PROTECTED] Tried this on Win2KPro SP3, Apache 1.3.27, PHP 4.2.3 and PHP 4.3.0 (both as module) and get the crash on same line. Actually as soon as I reference $attr->Name eg $tmpStr = $attr->Name; // crashes but if I remove the $attr->Name; line then the echo($node->nodeName." ".$node->xml."<BR>"); loop works OK. I am also experiencing crashes when I generate Excel spreadsheets with 4.3.0. My code generally works fine under 4.2.3 (except that an excel process is left running after each time the code is run). The following seems to be a minimal test case; <?php echo "Test started...<br/>\n"; $excel = new COM("Excel.Application") or die("Excel could not be started"); $workbook = "c:\\tmp\\in.xls";// can just be an empty wookbook $wkb = $excel->application->Workbooks->Open($workbook) or Die ("Did not open"); $sheet = $wkb->Worksheets(1); $sheet->activate; $sheet->name='Testing 123'; $y=6; for($i=0;$i<6;$i++){ $cell = $sheet->Cells($y+$i,1); // Select the cell (Row Column number) $cell->activate; // Activate the cell $cell->value = 'JimBob'; $cell = $sheet->Cells($y+$i,2); $cell->activate; $cell->value = 'Yer Baby'; } $file_name='c:/tmp/adtdump.xls'; if (file_exists($file_name)) {unlink($file_name);} $wkb->SaveAs($file_name); $wkb->Close(); // close the application $excel->Workbooks->Close(); $excel->ActiveWorkbook->Close("False"); $excel->Quit(); $excel->Release(); $excel = null; unset($excel); ?> If the for loop has $i < 1 then the test will fault one in around five times. Fault window is; Microsoft Excel: EXCEL.EXE - Application Error The instruction at "0x30033ddf" referenced memory at 0x660667f8. The memory could not be "read". With $i<10 is faults every time. and is then usually followed by an Apache Ap error and Apache restarts the child process (and uptime goes back to 0). With $i<6 it faults most of the time but I haven't seen an Apache Ap error after the Excel.exe one. Each time it faults I get an Excel.exe left in taskmanager. If it runs without faulting then I don't. ------------------------------------------------------------------------ [2002-12-26 01:57:49] [EMAIL PROTECTED] Latest PHP build don't solve this porblem :-\ I am use PHP for Win32 as CGI, may be this information can help fix this problem. DOM XML -> Microsoft XML Parser 4.? (latest) ------------------------------------------------------------------------ [2002-12-24 17:52:54] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [2002-12-24 07:55:40] [EMAIL PROTECTED] test.xml: <?xml version="1.0"?> <test a="g" b="false"> <v val="1">aa</v> <v val="2">bb</v> <v val="3">nn</v> </test> test.php: <? $MSXML = new COM("Msxml2.DOMDocument"); if ($MSXML->load("D:\\Inetpub\\wwwroot\\vphpmail\\test.xml")) { $nodeList = $MSXML->getElementsByTagName("v"); for ($i=0;$i<$nodeList->length;$i++) { $node = $nodeList->nextNode(); $attribs = $node->attributes; $attr = $attribs->getNamedItem("val"); echo($attr->Name."<BR>"); // This is crash echo($node->nodeName." ".$node->xml."<BR>"); } } else { echo("BAD<br>"); echo( "Error in file <b>".$MSXML->parseError->url."</B> at line <b>". $MSXML->parseError->line."</b> in pos <b>".$MSXML->parseError->linepos."</b>"); } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21172&edit=1