0

We've recently upgraded to PHP 7, and I'm trying to get things working. We were using a rather random xml2array program which is no longer working, and I'd like to replace it with SimpleXMLElement rather than debug it.

  • PHP is generally working.
  • Errors are displaying.
  • Everything works as long as I don't run SimpleXMLElement or simplexml_load_file. As soon as I try and run these (using XML from PHP manual example), I get 500 error.
Al Foиce ѫ
  • 4,195
  • 12
  • 39
  • 49
NessBird
  • 745
  • 1
  • 6
  • 15
  • Can you enable the php error log? You'll see more errors in the logfile than in the output of your script. – Imanuel Apr 18 '17 at 06:49

1 Answers1

0

The key here was to find the error logs. This post has some useful notes on that: 500 Internal Server Error for php file not for html

...Once I found the error logs, they informed me that SimpleXMLElement had not been installed, and this caused PHP to crash rather than display an error message. So to find the error, I had to track down the error file.

This post explains that PHP will refuse to catch a fatal error: How do I catch a PHP Fatal Error

Community
  • 1
  • 1
NessBird
  • 745
  • 1
  • 6
  • 15