Page 1 of 1

reading a remote https url

Posted: Mon Oct 03, 2005 6:14 am
by joy
How do we read a url remotely using PHP the code i used

$myurl='https://url';
$lines = file($myurl);

foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}

the error generated is "Notice: file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?"

how do I overcome this error

Posted: Mon Oct 03, 2005 6:42 am
by feyd
you need to have https enabled in the url opening wrappers.. that's something for your host to fix.

Posted: Mon Oct 03, 2005 8:07 am
by phpdevuk
I quite like using the snoopy class for things like this, it can be found on sourceforge at http://sourceforge.net/projects/snoopy the built in CURL functions in php can be quite good too, if somewhat complicated to use at times.