Har ett problem som jag inte lyckas lösa själv. Därför hoppas jag att det finns någon klokare som kan hjälpa mig.
Använder följande PHP-script för att lägga till en node till en XML fil.
[KOD]
<?php
if(!$dom = domxml_open_file("lib/test.xml")) {
echo "Error while parsing the document\n";
exit;
}
$root = $dom->document_element();
$child= $root->new_child("child", "");
$tmp = $child->set_attribute("id", "1");
$newchild = $child->new_child("child1", "test text 1");
$newchild = $child->new_child("child2", "test text 2");
$newchild = $child->new_child("child3", "test text 3");
$newchild = $child->new_child("child4", "test text 4");
$tmp = $dom->dump_file("lib/test.xml", false, true);
?>
[/KOD]
Då får jag följande fel från Apache webserver:
Warning: dump_file() [function.dump-file]: xmlIOHTTPCloseWrite: HTTP 'PUT' of 771 bytes to URI 'http://localhost/lib/test.xml' failed. HTTP return code: 405 in C:\Program\Apache Group\Apache2\www\dom_add_3.php on line 16
Windows XP Home, Apache 2.43 och PHP 4.3.0. PHP körs som API modul.
Någon som vet vad detta beror på?
Samma kod fungerar på Abyss Web Server där PHP körs som CGI modul.
Använder följande PHP-script för att lägga till en node till en XML fil.
[KOD]
<?php
if(!$dom = domxml_open_file("lib/test.xml")) {
echo "Error while parsing the document\n";
exit;
}
$root = $dom->document_element();
$child= $root->new_child("child", "");
$tmp = $child->set_attribute("id", "1");
$newchild = $child->new_child("child1", "test text 1");
$newchild = $child->new_child("child2", "test text 2");
$newchild = $child->new_child("child3", "test text 3");
$newchild = $child->new_child("child4", "test text 4");
$tmp = $dom->dump_file("lib/test.xml", false, true);
?>
[/KOD]
Då får jag följande fel från Apache webserver:
Warning: dump_file() [function.dump-file]: xmlIOHTTPCloseWrite: HTTP 'PUT' of 771 bytes to URI 'http://localhost/lib/test.xml' failed. HTTP return code: 405 in C:\Program\Apache Group\Apache2\www\dom_add_3.php on line 16
Windows XP Home, Apache 2.43 och PHP 4.3.0. PHP körs som API modul.
Någon som vet vad detta beror på?
Samma kod fungerar på Abyss Web Server där PHP körs som CGI modul.
Comment