php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42928 PHP crashes silently when CURLOPT_MAXCONNECTS is set
Submitted: 2007-10-11 13:07 UTC Modified: 2009-02-06 01:00 UTC
Votes:5
Avg. Score:4.6 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:2 (40.0%)
From: telsbern at uga dot edu Assigned:
Status: No Feedback Package: cURL related
PHP Version: 5.2.4 OS: Windows 2003 server sp2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
7 + 46 = ?
Subscribe to this entry?

 
 [2007-10-11 13:07 UTC] telsbern at uga dot edu
Description:
------------
On 2 different windows servers I have, php just crashes silently if I try to set any value at all for CURLOPT_MAXCONNECTS. 

If I have the line:

curl_setopt($ch, CURLOPT_MAXCONNECTS, someIntegerHere);

PHP just dies when it gets to that line. If I comment it out, the script works fine. It looks like php_curl.dll hasn't been changed in a while so I'm stumped. It works just fine on my redhat box.

Reproduce code:
---------------
<?php
	print("Hi!\n");
        $ch = curl_init("http://www.example.com/");
	curl_setopt($ch, CURLOPT_VERBOSE, true);
	curl_setopt($ch, CURLOPT_MAXCONNECTS, 5);
	print("Running curl_exec()...\n");
        curl_exec($ch); 
	print("Done!\n");
	$daErr = curl_error($ch);
	print_r($daErr);
	curl_close($ch); 
?>

Expected result:
----------------
Hi!
Running curl_exec()...
<HTML>
<HEAD>
  <TITLE>Example Web Page</TITLE>
</HEAD> 
<body>  
<p>You have reached this web page by typing &quot;example.com&quot;,
&quot;example.net&quot;,
  or &quot;example.org&quot; into your web browser.</p>
<p>These domain names are reserved for use in documentation and are not available 
  for registration. See <a href="http://www.rfc-editor.org/rfc/rfc2606.txt">RFC 
  2606</a>, Section 3.</p>
</BODY>
</HTML>

Done!


Actual result:
--------------
Hi!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-11 13:26 UTC] jani@php.net
Try making the errors show up by setting error_reporting = E_ALL and display_errors = On..
 [2007-10-11 14:19 UTC] telsbern at uga dot edu
Those options were both already what you suggested. I just verified them.
 [2007-10-11 18:16 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

Works fine for me on Linux, could be an issue with an old libcurl or 
something win32 specific. A backtrace would be super-useful in this 
case.
 [2007-10-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-10-28 14:00 UTC] webmaster at intobikes dot co dot uk
I have exactly the same problem on a server running Centos 5 with WHM/cPanel-11.  It's a brand new machine and is being readied for service with the latest stable versions of everything it needs. PHP is version 5.2.4

All error warnings are on, even notice and strict ones. CURL works fine with the "curl_setopt($ch, CURLOPT_MAXCONNECTS, someIntegerHere);" line removed, but otherwise fails silently. And you know how long they take to find!
 [2008-08-24 15:08 UTC] pttmail at gmail dot com
$this->curl = curl_init();
						
			curl_setopt($this->curl, CURLOPT_HEADER, $header);
			curl_setopt($this->curl, CURLOPT_VERBOSE, 0);
			curl_setopt($this->curl, CURLOPT_HTTPGET, 1);
            curl_setopt($this->curl, CURLOPT_RETURNTRANSFER,0);
            curl_setopt($this->curl, CURLOPT_VERBOSE,0);
            curl_setopt($this->curl, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_OLDEST);
            curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 30);
            curl_setopt($this->curl, CURLOPT_MAXCONNECTS, 10);
			//curl_setopt($this->curl, CURLOPT_COOKIE, $this->session);
            curl_setopt($this->curl, CURLOPT_URL, $this->url);
 [2009-01-29 22:21 UTC] webmaster at tubo-world dot de
This bug is still there in PHP 5.2.6 on Windows XP.
Calling 
curl_setopt($this->ch, CURLOPT_MAXCONNECTS, 10); 
will crash PHP silently. So no errors are returned which makes it very hard to indentify the bug.

There is no problem with this on a Linux machine.
 [2009-01-29 22:35 UTC] pajoye@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-02-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 26 12:01:25 2020 UTC