From: sheffmail at mail dot ru
Operating system: Linux
PHP version: 4.4.0
PHP Bug Type: cURL related
Bug description: Outputs "Cannot find server"
Description:
------------
I have a script which suppose to output remote page's content, but it
doesn't.
I have an assumption that it happens because the location pointed to by
URL in the script returns 'Location:' header and redirects to another page
+ using port different from 80. On Linux OS it outputs "Cannot find
server", on Windows it works OK and outputs the page. How can I make it
work in Linux ? Or if it's not because of OS, then why does it occur and
how could this be fixed?
Reproduce code:
---------------
set_time_limit(0);
$ch = curl_init();
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_MAXREDIRS,100);
curl_setopt($ch,CURLOPT_URL,"http://www.mtsu.edu/~devstud2/DSM080.html");
$buffer = curl_exec($ch);
if (curl_errno($ch) == CURLE_OK )
{
echo $buffer;
}
else
{
echo "no";
}
curl_close($ch);
Expected result:
----------------
The content of the page
Actual result:
--------------
The script just breaks without printing "no" or error or warning, some
times giving "Cannot find server" error.
--
Edit bug report at http://bugs.php.net/?id=34567&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34567&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34567&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34567&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34567&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34567&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34567&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34567&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34567&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34567&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34567&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34567&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34567&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34567&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34567&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34567&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34567&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34567&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34567&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34567&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34567&r=mysqlcfg