Page 1 of 1

Turn Off fopen() for URL

Posted: Fri Dec 28, 2007 3:52 pm
by tecktalkcm0391
How can I turn fopen() for URLs on because i keep getting this message

URL file-access is disabled in the server configuration in


EDIT: Acutally, what can I do in place of this, because I found the answer, but I don't have access to php.ini

Posted: Fri Dec 28, 2007 4:02 pm
by Christopher
Try the cURL library. Check your phpinfo() if you have that PHP extension installed.

Posted: Fri Dec 28, 2007 4:05 pm
by tecktalkcm0391
It is installed...

I was using:

Code: Select all

$fp = fopen($state,"r");
	while($data_in = fread($fp, 4096)){
		$data_output[] = $data_in;
	}
	$data = join('',$data_output);
	fclose($fp);


would this be right for cURL:

Code: Select all

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $state);
$getresponse = curl_exec ($ch);
$data = $getresponse;
curl_close($ch);
I want to make sure, because the site is live... but my host, had to randomly remove it without telling me.

Posted: Fri Dec 28, 2007 4:12 pm
by tecktalkcm0391
That isn't working... how would I do it for an XML File....