PHP 'file_get_contents' does not work from server

后端 未结 3 1158
春和景丽
春和景丽 2020-12-21 08:05

I have a website (PHP) hosted in Yahoo small business and application (Java) Hosted in Rackspace.

I am making a file_get_contents

相关标签:
3条回答
  • 2020-12-21 08:26

    Check the php.ini file and make sure similar is available as below

    ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. ; http://php.net/allow-url-fopen allow_url_fopen = On

    ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. ; http://php.net/allow-url-include allow_url_include = Off

    0 讨论(0)
  • 2020-12-21 08:32

    A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.

    0 讨论(0)
  • 2020-12-21 08:36

    You need to allow

    allow_url_fopen
    

    in your php.ini config file. Some hosts disallow it for security.

    0 讨论(0)
提交回复
热议问题