|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17782 Apache2 crashes on curl_exec()
Submitted: 2002-06-16 09:00 UTC Modified: 2002-07-10 23:36 UTC
From: erik at nflare dot com Assigned: sterling (profile)
Status: Closed Package: cURL related
PHP Version: 4.2.1 OS: WinXP
Private report: No CVE-ID: None
 [2002-06-16 09:00 UTC] erik at nflare dot com
The example script from the documentation causes the crash everytime:


$ch = curl_init ("");
$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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 09:09 UTC] erik at nflare dot com
Heres the error.log entry for the crash:

[Sun Jun 16 09:07:20 2002] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Sun Jun 16 09:07:21 2002] [notice] Parent: Created child process 2692
[Sun Jun 16 09:07:21 2002] [notice] Child 2692: Child process is running
[Sun Jun 16 09:07:22 2002] [notice] Child 2692: Acquired the start mutex.
[Sun Jun 16 09:07:22 2002] [notice] Child 2692: Starting 250 worker threads.
 [2002-06-16 09:46 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2002-06-16 17:15 UTC] erik at nflare dot com
Derick, I went to that page, but I couldn't find any information on how to run the backtrace in Windows.  Looked like all unix commands to me.  Could you please help me?

 [2002-06-16 17:21 UTC]
you will need to buy (or find a free one) a compiler, and a debugger.
the only supported by the PHP team (to my knowledge) is the MS Visual Studio.
for advice on getting a backtrace from that consult the product's documentation.

 [2002-06-17 09:02 UTC] kja at filanet dot dk
I have seen the same on Win2000.
With the example from the documentation

$ch = curl_init ("");
$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.
 [2002-06-17 15:32 UTC]

 [2002-07-10 23:36 UTC]
Can not reprocude with latest CVS and using curl 7.9.8 on

 [2003-02-17 15:26 UTC] nthomas at mailbox dot hu
I get the same behaviour with PHP 4.3.0 with Apache 1.3.24 on Windows XP. Both from command line and as an Apache module. Copy-pasted the example from the manual, and PHP crashed on me. Makes development a real headache if it doesn't work on Windows.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Aug 02 07:01:23 2021 UTC