ID: 33475 Updated by: [EMAIL PROTECTED] Reported By: edman007x at mac dot com -Status: Open +Status: Verified Bug Type: cURL related Operating System: Linux PHP Version: 5.1b2
Previous Comments: ------------------------------------------------------------------------ [2005-06-26 13:32:54] [EMAIL PROTECTED] Add 'unset($ch);' after the 'curl_close($ch);' call and it will work. ------------------------------------------------------------------------ [2005-06-26 01:49:37] edman007x at mac dot com i upgraded the server to 5.1b2 and it still didn't work ------------------------------------------------------------------------ [2005-06-25 22:21:44] edman007x at mac dot com Description: ------------ in my php 5.0.3 and php 5.0.4 servers curl did not write to the cookieJar file even though it is writable and there are cookies that were received phpinfo for working server is @ http:// edman007.optikhosting.com/phpinfo.php phpinfo for php server that doesn't work is @ http:// server.antiwindows.gotdns.com/phpinfo.php Reproduce code: --------------- <?php header('Content-type: text/plain'); $file = tempnam('/tmp', 'php_bug_test');//should be writable //a check echo is_writable($file)?'This File Is Writable':'This File Is not Writable'; echo "\n"; //and again echo system('ls -lah '.$file); echo "\n"; $ch = curl_init('http://www.yahoo.com/');///this site will give me a cookie curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, $file); curl_exec($ch); curl_close($ch); echo file_get_contents($file); unlink($file); ?> Expected result: ---------------- (i got this from a php 4.3.11 server) This File Is Writable -rw------- 1 nobody nobody 0 Jun 25 15:15 /tmp/php_bug_testKzXWcK -rw------- 1 nobody nobody 0 Jun 25 15:15 /tmp/php_bug_testKzXWcK # Netscape HTTP Cookie File # http://www.netscape.com/newsref/std/cookie_spec.html # This file was generated by libcurl! Edit at your own risk. .www.yahoo.com TRUE / FALSE 1149188400 FPB 311up3uh111brer0 Actual result: -------------- (i got this from my php 5.0.4 server) This File Is Writable -rw------- 1 nobody nobody 0 2005-06-25 16:15 /tmp/ php_bug_testYspF2w -rw------- 1 nobody nobody 0 2005-06-25 16:15 /tmp/ php_bug_testYspF2w ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33475&edit=1