[php-src] Issue #16023: https://github.com/readthedocs/readthedocs.org/issues/11615#issuecomment-2371071722
| From: | oleibman | Date: | Tue, 24 Sep 2024 12:48:00 +0000 |
| Subject: | [php-src] Issue #16023: https://github.com/readthedocs/readthedocs.org/issues/11615#issuecomment-2371071722 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247874@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/16023
Author: oleibman
### Description
The following code:
```php
php -r "file_get_contents('https://phpspreadsheet.readthedocs.io/en/latest/topics/images/01-03-filter-icon-1.png');"
```
The command above is issued on the command line, but the same result will happen within a program.
Resulted in this output:
```
Warning:
file_get_contents(https://phpspreadsheet.readthedocs.io/en/latest/topics/images/01-03-filter-icon-1.png):
Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
in Command line code on line 1
Call Stack:
0.0007 473600 1. {main}() Command line code:0
0.0013 473632 2. file_get_contents($filename = 'https://phpspreadsheet.readthedocs.io/en/latest/topics/images/01-03-filter-icon-1.png')
Command line code:1
```
But I expected this output instead:
```
// no warning/error message
```
We have been using this code for years. It works with latest versions of Php8.0 (8.0.30) and Php8.1
(8.1.28), but not 8.2 (8.2.18) nor 8.3 (8.3.6) (problem showed up yesterday for the first time, I
had not applied any Php maintenance since its last successful run). I raised an issue with
readthedocs (https://github.com/readthedocs/readthedocs.org/issues/11615), but they think it is a
problem with Php, not with their server. We have set allow_url_fopen to true in php.ini in all of
8.0/8.1/8.2/8.3.
### PHP Version
PHP 8.2.18, PHP 8.3.6
### Operating System
Windows, Ubuntu