php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74580 fopen() cannot handle urls longer than ~8k
Submitted: 2017-05-12 11:53 UTC Modified: 2017-05-21 04:22 UTC
From: bugs at freshsite dot de Assigned:
Status: No Feedback Package: Streams related
PHP Version: 5.6.30 OS: probably all
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: bugs at freshsite dot de
New email:
PHP Version: OS:

 

 [2017-05-12 11:53 UTC] bugs at freshsite dot de
Description:
------------
---
From manual page: http://www.php.net/function.fopen
---

If the URL, given to fopen(), is longer than 8k, it ALWAYS returns a FALSE instead of a handle.

In my case (Debian 8) the URL length was "limited" by up to 7655 chars (this value may vary on systems!). When having more chars, fopen will always fail.

When using cURL instead of fopen, this limit does NOT occur!

Note: 
The URL length is a client sided value (== php sided), that means that fopen seems to have an internal ~8k buffer for the URL parameter. 
This buffer is NOT configurable through php.ini - but it should.


However, you should mention this ~8k buffer AT LEAST in the documentation!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-12 18:49 UTC] requinix@php.net
-Status: Open +Status: Feedback -Package: Documentation problem +Package: Streams related
 [2017-05-12 18:49 UTC] requinix@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 the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

I'm curious to see what this 7655 URL is, and the equivalent cURL code you tried. Have you verified that the remote server was not responding with a 414?
 [2017-05-21 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC