Hi
I have problem getting XML file with curl.
I get empty XML and error:
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "1" in /home2/public_html/xmlupdate.php on line 62
xml 1 not loaded.
the code for curl:
$ch =curl_init();
curl_setopt($ch, CURLOPT_URL,$xml_url_1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, realpath("certs/ca.pem"));
curl_setopt ($ch, CURLOPT_SSLCERT, realpath("certs/client.pem"));
curl_setopt($ch, CURLOPT_SSLKEY, realpath("certs/key.pem"));
curl_setopt($ch, CURLOPT_SSLKEYPASSWD, "2255");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)');
$xml_url = curl_exec ($ch);
echo curl_error($ch);
curl_close ($ch);
$xml = simplexml_load_file(utf8_encode($xml_url), 'SimpleXMLElement', LIBXML_NOCDATA);
When I acces XML with web broser it works, there is something wrong in my curl code.
Any ideas?
Thanks