Bug #53018 [Asn->Wfx]: file_get_contents does not follow 301 and 302 redirects with curlwrappers
Edit report at https://bugs.php.net/bug.php?id=53018&edit=1
ID: 53018
Updated by: mike@php.net
Reported by: techs at remsys dot com
Summary: file_get_contents does not follow 301 and 302
redirects with curlwrappers
-Status: Assigned
+Status: Wont fix
Type: Bug
Package: cURL related
Operating System: Linux x86_64 CentOS release 5.5
PHP Version: 5.2.14
Assigned To: cataphract
Block user comment: N
Private report: N
New Comment:
curlwrappers have been removed in PHP-5.5
Previous Comments:
------------------------------------------------------------------------
[2013-02-20 02:41:23] dev at maliayas dot com
I've had the same bug. My PHP build was compiled with --with-curlwrappers and it didn't
follow "Location: " HTTP headers. Then I recompiled it without --with-curlwrappers and it
just worked as expected. So the problem must be with the code of Curl Wrapper. After a research, I
couldn't find any configuration place for curl wrapper i.e. in php.ini or somewhere else. So
the "CURLOPT_FOLLOWLOCATION" setting may be hardcoded with Curl Wrapper to
"off". I don't have any further information, just wanted to give some clue.
------------------------------------------------------------------------
[2012-12-24 13:49:32] pierrick@php.net
cataphract, any idea on how to reproduce this ? or what was the problem ? I'm
trying to fix as much bug as possible in ext/curl but can not reproduce this one.
------------------------------------------------------------------------
[2010-10-18 17:45:29] techs at remsys dot com
As a workaround we have recompiled php without --with-curlwrappers option and file_get_contents
started to work as it should.
We have latest curl on that server curl-7.15.5-9.el5 here is version info:
curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
------------------------------------------------------------------------
[2010-10-08 20:27:31] techs at remsys dot com
Thank you for reply.
Well same situation with max_redirects. It works only for cli. It seems SAPI ignore it and set to
zero or 1.
And yes both versions are comiled with curlwrappers. You can see phpinfo() here
isonet.ru/test/pi.php
I would really appreciate any other thoughts or suggestions.
Thank you.
------------------------------------------------------------------------
[2010-10-08 05:07:37] aharvey@php.net
The redirections are followed for me both in the CLI and Apache SAPIs; I can't see any obvious
reason why one would be different to the other.
Immediate thoughts:
- Does your Apache script set any context options at any point? There is a HTTP context option
called "max_redirects" which controls this behaviour -- if it's set to 0, then
redirects aren't followed.
- Did either (or both) builds have --with-curlwrappers enabled at build time? You can check that in
the "Configure Command" line in phpinfo().
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=53018
--
Edit this bug report at https://bugs.php.net/bug.php?id=53018&edit=1
Thread (7 messages)