我正在尝试运行的php脚本存在问题。在我的本地环境中,一切都运行良好,没有任何问题,但在Linux服务器上,一个脚本根本没有做任何事情。
我发现如果我删除这些行:
unset($sxe->XPath("DirectoryEntry[$field]")[0]->{0});
和
unset($note->xpath("notes[$field]")[0]->{0});
然后脚本将运行(显然不是我想要的,因为这些行被删除但它至少做了一些事情)。有了线条,它什么也没做。甚至不会回声"你好"
脚本如下。 真的很感激任何帮助。 不是chmod问题。 PhP版本是5.3.3
<?php
if (isset($_POST['submit']))
{
$id = $_POST['hidden'];
$field = $id;
xml = simplexml_load_file("../telbook.xml");
$sxe = new SimpleXMLElement($xml->asXML());
$xml2 = simplexml_load_file("../notes.xml");
$note = new SimpleXMLElement($xml2->asXML());
unset($sxe->XPath("DirectoryEntry[$field]")[0]->{0});
$sxe->asXML("../telbook.xml");
unset($note->xpath("notes[$field]")[0]->{0});
$note->asXML("../notes.xml");
}
header("location: ../update.php");
?>