|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-16 09:00 UTC] erik at nflare dot com
The example script from the documentation causes the crash everytime:
<?php
$ch = curl_init ("http://www.erikmc.com/index.html");
$fp = fopen ("example_homepage.txt", "w");
curl_setopt ($ch, CURLOPT_FILE, $fp);
$fp1 = fopen ("example_homepage1.txt", "w");
curl_setopt ($ch, CURLOPT_HEADER, 0);
$fp2 = fopen ("example_homepage2.txt", "w");
curl_exec ($ch);
$fp3 = fopen ("example_homepage3.txt", "w");
curl_close ($ch);
$fp4 = fopen ("example_homepage4.txt", "w");
fclose ($fp);
$fp5 = fopen ("example_homepage5.txt", "w");
?>
I wrote all the fopens so I could see which statement it crashed on everytime. And that statement is this one:
curl_exec ($ch);
Whenever I run this script it says Apache2 has encountered an error and needs to be closed, but the ie windows doesnt close, and the Apache2 server is still running. Maybe thats WinXP handling an error quietly or something.
The example_homepage.txt is still blank.
I enabled ctype, curl, gd2, ming, printer, and zlib.
I thank you for your time.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
I have seen the same on Win2000. With the example from the documentation <?php $ch = curl_init ("http://www.example.com/"); $fp = fopen ("example_homepage.txt", "w"); curl_setopt ($ch, CURLOPT_FILE, $fp); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_exec ($ch); curl_close ($ch); fclose ($fp); ?> it crashes (application error/GPF) with PHP 4.2.1 both when run from commandline and as module under Apache 1.3.24 It works fine with PHP 4.1.2. If removing the line curl_setopt ($ch, CURLOPT_FILE, $fp); it works fine with PHP 4.2.1 but that is of course a totally different behavior. Seems to be a CURL bug ... I have not invested time in figuring out how to do a backtrace on Win32. I hope above should be sufficiently detailed to track down the issue.