We had a php script using simplexml_load_file
to load an external XML file. It worked fine up until yesterday. From the troubleshooting I have done, it seems I can no longer use the external URL to load the file. I tested downloading the XML files and using the local path to the file and the script works fine.
So this works: $xml = '/home/accountname/public_html/filename.xml';
But this doesn't work anymore: $xml = 'https://www.example.com/filename.xml';
We have not made any changes to the website or script. The web host has said they haven't changed anything on the web server. But obviously something has changed.
I have checked that allow_url_fopen
is on and SimpleXML is enabled. The version of php has not changed.
Any thoughts on what else I can check that may have caused this change?
Update: we did find that the external server had an expired SSL cert which was why the loading of the XML file failed. We used code from this answer as a workaround for now: https://stackoverflow.com/a/32622437/13653062