|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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 "example.com",
"example.net",
or "example.org" 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!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 05:00:01 2025 UTC |
$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);