Fopen problem

software development


I ve noted that the “fopen” function is disabled on dreamhost php.ini and i ve also read that we can use curl instead. I’ve written this code:

$file = fopen ("$url", “r”);
if (!$file) {
echo “

Unable to open remote file.\n”;
while (!feof ($file)) {
$line = fgets ($file, 1024);
$xmlFileData .= $line;

How can i do the same thing using curl ?

Thanks in advance


No it isn’t. URL file access is disabled, which means you cannot open URLs with fopen(). You can still access local files by relative or absolute methods.

You will find various cURL examples on the DreamHost Wiki.

si-blog | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]