|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-20 22:00 UTC] sniper@php.net
[2005-09-28 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 06:00:01 2025 UTC |
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.