rabark Posted February 13, 2008 Share Posted February 13, 2008 I'm trying to open a URL via the file_get_contents method, but it's not working (throws the "failed to open stream: No such file or directory " message). The phpinfo method shows that PHP has been configured with allow_url_fopen set to "On". It should be noted however that I'm trying to access a "https" URL. Does file_get_contents() work with https? Link to comment https://forums.phpfreaks.com/topic/90969-opening-urls-as-files/ Share on other sites More sharing options...
rhodesa Posted February 13, 2008 Share Posted February 13, 2008 It should. Is the page you are trying to get restricted? As in you need to login in with a username/password first? Also, please post some code Link to comment https://forums.phpfreaks.com/topic/90969-opening-urls-as-files/#findComment-466217 Share on other sites More sharing options...
Isityou Posted February 13, 2008 Share Posted February 13, 2008 HTTPS works fine with file_get_contents() Link to comment https://forums.phpfreaks.com/topic/90969-opening-urls-as-files/#findComment-466218 Share on other sites More sharing options...
rabark Posted February 13, 2008 Author Share Posted February 13, 2008 Thank you for the quick replies To my knowledge, the page is not restricted in any way. Also, I am able to copy and paste the URL from the warning message to the address bar and access the page (a bunch of XML) just fine. Also, please post some code My previous theory was that https doesn't work with file methods. My current theory is that the problem lies somewhere on the server or network since I'm able to use it on some URLs but not others and I am sending emails back and forth to the administrator. For what it's worth however, here is the code of interest (URL has been censored for privacy, but its structure is the same): $url = "https://some.host.com:1234/directory/WebService.jws/mymethod?arg1=value1&arg2=value2&arg3=value3&"; $xml = file_get_contents($url); print "This is what was returned:<br><br>"; print nl2br($xml); Link to comment https://forums.phpfreaks.com/topic/90969-opening-urls-as-files/#findComment-466233 Share on other sites More sharing options...
PHP Monkeh Posted February 13, 2008 Share Posted February 13, 2008 .jws = Java Web Start isn't it? I'm not sure how file_get_contents() handles arguments in the URL as well. Is the file you're trying to read the .jws or mymethod? Link to comment https://forums.phpfreaks.com/topic/90969-opening-urls-as-files/#findComment-466254 Share on other sites More sharing options...
rabark Posted February 13, 2008 Author Share Posted February 13, 2008 Java Web Service. At least I think that's what it is; I'd have to get in touch with the developers of the Web service to verify it. What I'm trying to read is the output of mymethod which is in XML format. Link to comment https://forums.phpfreaks.com/topic/90969-opening-urls-as-files/#findComment-466285 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.