php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67966 Use Linux wget,curl can get content,but php file_get_contents and cURL can't.
Submitted: 2014-09-05 11:05 UTC Modified: 2014-09-05 12:06 UTC
From: jifei at outlook dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.4.32 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jifei at outlook dot com
New email:
PHP Version: OS:

 

 [2014-09-05 11:05 UTC] jifei at outlook dot com
Description:
------------
A link use PHP file_get_contents return null,Use Linux commend wegt or linux curl is ok.Other link use file_get_contents is ok.Because the 
 link has special characters?


Test script:
---------------
PHP
<?php

//this is empty
echo file_get_contents('http://irm.cninfo.com.cn/ircs/interaction/irmInformationList.do?pageNo=1&beginDate=2011-08-05&endDate=2014-09-05');

//php cURL is also empty 


//other link is ok
echo file_get_contents('http://irm.cninfo.com.cn/ircs/interaction/irmInformationList.do?pageNo=1');
?>

Linux

//this is ok
wget http://irm.cninfo.com.cn/ircs/interaction/irmInformationList.do?pageNo=1&beginDate=2011-08-05&endDate=2014-09-05

//this is ok
curl http://irm.cninfo.com.cn/ircs/interaction/irmInformationList.do?pageNo=1&beginDate=2011-08-05&endDate=2014-09-05


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-05 12:06 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2014-09-05 12:06 UTC] johannes@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.

Your URL gives me a blank result in m browser, too.

Also mind when typing

wget http://irm.cninfo.com.cn/ircs/interaction/irmInformationList.do?pageNo=1&beginDate=2011-08-05&endDate=2014-09-05

the shell will split at the & which is a shell special character so what you doingwith that command is to fetch http://irm.cninfo.com.cn/ircs/interaction/irmInformationList.do?pageNo=1 in the background and then try to execute beginDate=2011-08-05 and endDate=2014-09-05 as shell commands. Better escape it

wget 'http://irm.cninfo.com.cn/ircs/interaction/irmInformationList.do?pageNo=1&beginDate=2011-08-05&endDate=2014-09-05'

Nothing PHP releated here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 13:01:27 2024 UTC