Skip to content

https://github.com/readthedocs/readthedocs.org/issues/11615#issuecomment-2371071722 #16023

@oleibman

Description

@oleibman

Description

The following code:

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 (readthedocs/readthedocs.org#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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions