Warning: File_Get_Contents

File_Get_Contents - webfreelance.info

File_Get_Contents - webfreelance.info

There are times when we see following error: Warning: file_get_contents (http://www.xyz.com/url) [function:file-get-contents]: failed to open stream on line abc

This error occurs when web hosting provider has restricted server resources to prevent overuse.

How to fix it:

In order to fix this issue you need to make certain changes in your php.ini file, php.ini file has all the php and other related application settings.

Locate and open php.ini file, look for below mentioned line:

allow_url_fopen = Off

Change “off” value to “on”, as mentioned below:

allow_url_fopen = On

In case, you do not have permission to access php.ini file, you will have to contact to your service provider and ask them to enable the “allow_url_fopen” setting.

For further reading about Warning: File_Get_Contents, refer to the following url: http://php.net/manual/en/function.file-get-contents.php

Be Social, Share!