surfnjunkie Posted May 8, 2009 Share Posted May 8, 2009 I am having a problem with this code working on one server, but not on the other server. This is the code that I am using: $xml2 = simplexml_load_file("https://p2.myserver.com/app/apixml.php?project=My%20Videos&user=myusername&id=myfancyid"); foreach($xml2->medialist->media as $media){ $http = $media->http; echo "<br>$http"; } Here is a sample portion of the xml output: <playlist version='1' xmlns='http://xspf.org/ns/0/'> <medialist> <media> <videosource>http://mdv1.net/videos/HuluAdsTranscode_2813_FLASH_700K_16x9_29.97_x264.mp4</videosource> <thumb>http://p2.myserver.com/img/My_Videos/a07390b682df54d4fd837f56960b6ffc.jpg</thumb> <project>My Videos</project> <rtsp>rtsp://p2.myserver.com/c2aba58ea880bd54fe7eef54f4b8d822.sdp</rtsp> <http>http://p2.myserver.com/c2aba58ea880bd54fe7eef54f4b8d822.sdp</http> </media> <media> <videosource>http://mdv1.net/videos/HuluAdsTranscode_2805_1073_FLASH_700K_4x3_29_97_x264.mp4</videosource> <thumb>http://p2.myserver.com/img/My_Videos/d464c582d02935ac3af5d7f224cfc211.jpg</thumb> <project>My Videos</project> <rtsp>rtsp://p2.myserver.com/461ea4a66063e1e95eec11dde824d10c.sdp</rtsp> <http>http://p2.myserver.com/461ea4a66063e1e95eec11dde824d10c.sdp</http> </media> </medialist> </playlist> On my testing server I am getting a response that I would expect: http://p2.myserver.com/c2aba58ea880bd54fe7eef54f4b8d822.sdp http://p2.myserver.com/461ea4a66063e1e95eec11dde824d10c.sdp the output of the 2 files. But on my other server I am getting this error: Warning: simplexml_load_file() [function.simplexml-load-file]: https://p2.tipmotion.com/app/apixml2.php?project=My%20Videos&user=YWpib2xhbm9z&id=YWFyb24=:1: parser error : Document is empty in /home/mdvcom5/public_html/a/index.php on line 34 Warning: simplexml_load_file() [function.simplexml-load-file]: in /home/mdvcom5/public_html/a/index.php on line 34 Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /home/mdvcom5/public_html/a/index.php on line 34 Warning: simplexml_load_file() [function.simplexml-load-file]: https://p2.tipmotion.com/app/apixml2.php?project=My%20Videos&user=YWpib2xhbm9z&id=YWFyb24=:1: parser error : Start tag expected, '<' not found in /home/mdvcom5/public_html/a/index.php on line 34 Warning: simplexml_load_file() [function.simplexml-load-file]: in /home/mdvcom5/public_html/a/index.php on line 34 Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /home/mdvcom5/public_html/a/index.php on line 34 Warning: Invalid argument supplied for foreach() in /home/mdvcom5/public_html/a/index.php on line 35 I wanted to see if anyone has any idea why this could be happening? or if there is anything on the server I need to change. Link to comment https://forums.phpfreaks.com/topic/157394-simplexml_load_file/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.