I’m creating a PHP application that for a movie theater that, when accessed by a user, fetches an external XML document, saves it to our server. That XML file is then used to load the showtimes and other movie information. If the file on our server is older than 15 minutes, it’ll be overwritten, otherwise, it’ll load the existing one. I already pretty much finished the application, and it works perfect on my XAMPP test server, however it fails to work on the live server.

The external XML file is located at this URL: http://45502.formovietickets.com:2235/showtimes.xml. Our server that I am trying to save the file to is on one of HostGator’s Linux-based servers. Using PHP’s curl functions, I have been able to successfully load the XML file on the XAMPP test server only. On the live server, it simply fails to connect.

I feel like it might be an some sort of access restriction on the formovietickets.com server, but the people behind it insist there isn't any sort of restriction going on. Does anyone know a work around for this issue?

<?php $url = 'http://45502.formovietickets.com:2235/showtimes.xml'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if(curl_exec($ch) === false) { echo 'Curl error: '.curl_error($ch); } else { echo 'Retrieved file with no errors!'; } curl_close($ch); ?>

What Have I Tested?

I’ve tried transferring the php.ini file over from XAMPP to the live server and it still fails.

I was able to successfully retrieve an XML file located on another external server.

I’ve tested the code on a Windows-based server and the problem persists.

NOTE: If you load the URL more than a couple times from the same IP address in less than 15 minutes, you’ll get an error saying “Too many requests from this IP address”. Just saying in case you try testing it out.