Warning: file_get_contents()....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Warning: file_get_contents()....

Post by spamyboy »

How can I fix it ?
Warning: file_get_contents(): URL file-access is disabled in the server configuration in /home/spamyboy/public_html/engine/modules/show.full.php on line 3 Warning: file_get_contents(http://www.468x60.lt/refer.php?5556): failed to open stream: no suitable wrapper could be found in /home/spamyboy/public_html/engine/modules/show.full.php on line 3
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you don't.
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

so there is no posbile way to fix it without server admin ?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

yup
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Re: Warning: file_get_contents()....

Post by AKA Panama Jack »

spamyboy wrote:How can I fix it ?
Warning: file_get_contents(): URL file-access is disabled in the server configuration in /home/spamyboy/public_html/engine/modules/show.full.php on line 3 Warning: file_get_contents(http://www.468x60.lt/refer.php?5556): failed to open stream: no suitable wrapper could be found in /home/spamyboy/public_html/engine/modules/show.full.php on line 3
Check and see if the server has CURL installed. You can use that instead of file_get_contents. I ran into the same thing on a shared hosting service a few weeks ago. It's one of the stupidest things I have ever seen. They have disabled all URL usage in the file functions but they have installed CURL. So basically you have to rewrite all of your file calls to URLs to use CURL instead.

On the game we are developing we use file calls to URLs to access our stat tracking server and now we are going to have to add a check to the installer and change the code so it can use CURL if the file URL calls are disabled. We can't just stick with CURL because some hosts do not have it installed.

Pain in the butt. :p
Post Reply