reading a remote https url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
joy
Forum Newbie
Posts: 1
Joined: Mon Oct 03, 2005 6:06 am

reading a remote https url

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you need to have https enabled in the url opening wrappers.. that's something for your host to fix.
User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

Post 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.
Post Reply