1

Since I updated my MAC's OS (to the latest, OSX Mavericks) I noticed, that there was no content on my page (it's a php project with much code).

But the point is, that the problem occurs every time I try to load an XML file via Simplexml.

Here's the code:

$file = __DIR__ . '/myfile.xml';
$xml  = simplexml_load_file($file);

But there is no error, it's just an empty page (no HTML source to see in the browser). And I didn't turn error reporting off. And the path is also correct (is_file() returns true).

And like I said, before the OS update it worked well.

4

2 回答 2

2

更新到 Mavericks 后我遇到了同样的问题。当我尝试调用simplexml_load_file页面崩溃。我用$content = file_get_contents($xml); $config = new SimpleXMLElement($content);而不是simplexml_load_file它帮助了我。

于 2013-10-30T19:38:27.133 回答
1

我的 Mac 在更新到 Mavericks 后也在做同样的事情。每当我调用 simplexml_load_file 时,httpd 服务实际上就会崩溃,因此不会生成任何 php 错误。检查 /Library/Logs/DiagnosticReports/ 以获取错误日志。我还没有找到解决办法。

更新到 XAMPP Mac OS X 1.8.3 PHP 5.5 为我解决了这个问题。http://www.apachefriends.org/en/xampp-macosx.html

于 2013-10-30T19:06:42.833 回答