Edit report at http://bugs.php.net/bug.php?id=51890&edit=1
ID: 51890 Updated by: ka...@php.net Reported by: seizu at gmx dot at Summary: CURL Problem -Status: Open +Status: Bogus Type: Bug Package: cURL related Operating System: Windows XP PHP Version: 5.3.2 New Comment: You cannot do a writable operation using CURLOPT_FILE when the file pointer is opened with 'r', use 'wb+' instead of 'rb+'. Previous Comments: ------------------------------------------------------------------------ [2010-05-22 23:10:16] seizu at gmx dot at Description: ------------ The script copy the URL into an existing file (robot.txt) The error occurs when you run the test script from the command line by providing the absolut path of your php.exe like >c:\php\php.exe test.php When you don't provide the absolut php path, the problem does not occure >php test.php Test script: --------------- <?php $outfile="c:\\robots.txt"; $infile="http://www.astrobox.at/robots.txt"; $ch = curl_init($infile); $fo = fopen($outfile, "rb+" ); curl_setopt($ch, CURLOPT_FILE, $fo); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fo); ?> Expected result: ---------------- nothing Actual result: -------------- C:\phpda>c:\php\php.exe C:\phpda\test.php PHP Warning: curl_setopt(): the provided file handle is not writable in C:\phpda\test.php on line 7 Warning: curl_setopt(): the provided file handle is not writable in C:\phpda\test.php on line 7 User-agent: * Disallow: /administrator/ Disallow: /cache/ Disallow: /components/ Disallow: /editor/ Disallow: /help/ Disallow: /images/ Disallow: /includes/ Disallow: /language/ Disallow: /mambots/ Disallow: /media/ Disallow: /modules/ Disallow: /templates/ Disallow: /installation/ Disallow: /astrobox/produkte/ Disallow: /option/ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51890&edit=1