PHP file_get_contents returning false

前端 未结 4 1841
南笙
南笙 2021-01-04 00:12

Maybe I\'ve been sat here too long staring at this but WHY would file_get_contents return false here? I\'ve cut and paste the URL and it works fine

4条回答
  •  难免孤独
    2021-01-04 00:26

    You may need to enable allow_url_fopen in your php.ini

    http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen

    From the documentation:

    This option enables the URL-aware fopen wrappers that enable accessing URL object like files.

    Your server may be preventing you from opening a file located at a URL using file_get_contents.

提交回复
热议问题