php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38340 Curl error : 'Empty reply from server'
Submitted: 2006-08-05 07:03 UTC Modified: 2006-08-05 15:01 UTC
From: manikandan dot r at greynium dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.1.4 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: manikandan dot r at greynium dot com
New email:
PHP Version: OS:

 

 [2006-08-05 07:03 UTC] manikandan dot r at greynium dot com
Description:
------------
When i am accessing the remote url through CURL, got the following error:

'Empty reply from server'

How to resolve it?

Thanks in advance

--
Mani

Reproduce code:
---------------
/* crawling starts here */
	$ch = curl_init($url);
	curl_setopt ($ch, CURLOPT_FILE, $fp);
	curl_setopt ($ch, CURLOPT_FAILONERROR, true);
	curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);

    /* if crawling fails, mail will be sent */
	if(!curl_exec($ch)) {

Expected result:
----------------
Expected to get the content of the remote url

Actual result:
--------------
'Empty reply from server'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-05 10:45 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
 [2006-08-05 12:50 UTC] manikandan dot r at greynium dot com
I think following code snippet will help you to diagnose the problem.

$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_setopt ($ch, CURLOPT_FAILONERROR, true);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($ch);
echo curl_error($ch);

I have used the above code in my php file and it give me an "Empty reply from server" instead of the url content.

Actually i used to pass city name in url dynamically, the issue is its working well with some cities.

But there wont be any problem with city names it seems.

Hope above explanation help you to give me an solution

---
Mani
 [2006-08-05 15:01 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The PHP/cURL code works properly, what's happening is that the 
URl you are trying to access returns a blank page (usually due 
to scripting error on the server).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC