When i try to use the file_get_contents() function to get the content of a URL,
i get the following error:
Warning: file_get_contents($http) [function.file_get_contents]: failed to open stream: No such file or directory in /url on line 18
What could be the cause of such error and the solution.
I’m using a shared server, how do i enable the function locally on my
own hosting account.
Run phpinfo() and check the value for Registered PHP Streams in the topmost table. In order to be able to load urls the value ‘http’ should be there (among others). If not, you might need to ask your host to enable it. If that is not successful, you could be able to do the same with curl functions, however more complicated - that is, if your host provides curl as well.