php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43550 Out of memory fatal error using the dom schemaValidate function
Submitted: 2007-12-10 01:50 UTC Modified: 2008-01-31 01:00 UTC
From: laura at websalad dot com dot au Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.2CVS-2007-12-10 (snap) OS:
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: laura at websalad dot com dot au
New email:
PHP Version: OS:

 

 [2007-12-10 01:50 UTC] laura at websalad dot com dot au
Description:
------------
Using the dom function schemaValidate function occurs a the following error: Fatal error: Out of memory (allocated 8650752) (tried to allocate 63 bytes) in /home/arrowvoi/arrowvoice/html/xmlforms/tools.php on line 48

The line of the error is (if (!$dom->schemaValidate($schema)) ).

I already put the memory limit to 256MB using a local php.ini, the hosting has it at 32MB, but it didn't work.  I also tried with memory_limit -1.

I'm using php 5.2.3.  I have also the same function in my Windows Vista PC and it works propertly, but in the server it doesn't.

I would really appreciate any help cause I've been working with this for a long time and I haven't found a solution.

Reproduce code:
---------------
		function validateXML($formName, $xmlUrl, $xmlBody, $schema){
			libxml_use_internal_errors(true);
			$dom = new DomDocument();
			$dom->load($xmlUrl); 
			if (!$dom->schemaValidate($schema)) {
				$valid = false;
				$errorMessage = $this->libxml_display_errors();  
				$validationMail = $this->createValidationMail($formName, $xmlBody, $errorMessage);
			} else {
			  $valid = true;
			  $validationMail = '';
			}
			return $validationMail;		  
		}	


Expected result:
----------------
The function should finished successfully returning a validation String with the results.

Actual result:
--------------
Fatal error: Out of memory (allocated 8650752) (tried to allocate 63 bytes) in /home/arrowvoi/arrowvoice/html/xmlforms/tools.php on line 48


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-14 18:51 UTC] crescentfreshpot at yahoo dot com
That is not reproducible code.
 [2008-01-23 11:26 UTC] rrichards@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.


 [2008-01-31 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 23:01:26 2019 UTC