Search code examples
phpmacoscrashsimplexmlosx-mavericks

simplexml_load_file results an empty page


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.


Solution

  • My Mac is doing the same thing after updating to Mavericks. The httpd service is actually crashing whenever I call simplexml_load_file, so no php errors ever get generated. Check /Library/Logs/DiagnosticReports/ for error logs. I haven't found a fix yet.

    Updating to XAMPP Mac OS X 1.8.3 PHP 5.5 fix this issue for me. http://www.apachefriends.org/en/xampp-macosx.html