Php vererek hata XML Loading

5 Cevap php

Ben php xml yüklemek çalışıyorum

$doc = new DOMDocument();
$doc->load("LoginVal.xml");

Ben bir hata alıyorum

Uyarı: DOMDocument :: DOMDocument () bekler en az 1 parametre, 0 C olarak verilir: \ Program Files \ Apache Group \ Apache2 \ htdocs \ merhaba.php 5. satırdaki

Ölümcül hata: tanımsız yöntemi DOMDocument Çağrı :: load () C: \ Program Files \ Apache Group \ Apache2 \ htdocs \ merhaba.php 7. satırda

Regards, Hemant

5 Cevap

Obiviously bir parameter missing yapıcısı yoktur. Böyle bir şey deneyin

$dom = new DOMDocument('1.0', 'iso-8859-1');

Nesnenin onu bekliyor dediği gibi uyarı örneği çünkü Ölümcül hata parametre kontrol http://us3.php.net/manual/en/domdocument.construct.php

here, bu (özellikle # 2 comment) bilinen bir sorun gibi görünüyor yılında yorumuna bir göz atın.

Kullanıcı-yorumları okumak Lütfen DOMDocument::__construct() . There is a talk about exactly this error when using PHP5 on Windows machines (which most likely matches your configuration). I'm quoting christian dot reinecke at web dot de:

[...] make sure you're not overwritting this dom library by another (f.e. extension=php_domxml.dll in php.ini). XAMPP f.e. delivers its standard version with php_domxml.dll which ends up in this error message

Lütfen php.ini hiçbir php_domxml.dll-uzantısı olduğundan emin olun.

tam dosya yolunu deneyin

Seninki

$doc = new DOMDocument();
$doc->load("LoginVal.xml");

Denemek

$doc = new DOMDocument();
$doc->load("/path/to/LoginVal.xml");