clarencek Posted June 28, 2006 Share Posted June 28, 2006 Hi, I host with GoDaddy.com and am receiving an error when trying to use the file_get_contents() function:"Warning: file_get_contents(): URL file-access is disabled in the server configuration"I know with GoDaddy, I can set up a custome php.ini file. Is that where I can make the changes to enable file-access? I am a newbie so have no idea how to do this. Any help is greatly appreciated.Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/13134-enabling-url-file-access/ Share on other sites More sharing options...
wildteen88 Posted June 28, 2006 Share Posted June 28, 2006 It looks like you cannot specify a url in the parenthesesis, ie:file_get_contents("http://www.mysite.com/filename.php");Try a relative path instead if the file is on your server. or see if you can turn on [b]allow_url_fopen[/b] setting in the php.ini. Also GoDaddy may have safe_mode trun one which may be causing this. Quote Link to comment https://forums.phpfreaks.com/topic/13134-enabling-url-file-access/#findComment-50503 Share on other sites More sharing options...
clarencek Posted June 28, 2006 Author Share Posted June 28, 2006 [!--quoteo(post=388931:date=Jun 28 2006, 01:09 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 28 2006, 01:09 PM) [snapback]388931[/snapback][/div][div class=\'quotemain\'][!--quotec--]Try a relative path instead if the file is on your server. or see if you can turn on [b]allow_url_fopen[/b] setting in the php.ini.[/quote]So, being the newbie, I'm not even sure how to turn on the allow_url_fopen in the php.ini. Can someone walk me through this please? Quote Link to comment https://forums.phpfreaks.com/topic/13134-enabling-url-file-access/#findComment-50504 Share on other sites More sharing options...
wildteen88 Posted June 28, 2006 Share Posted June 28, 2006 You said you had access to your php.ini? You just open it up and find the line that says [i]allow_url_fopen = Off[/i] to [i]allow_url_fopen = On[/i]It may not state Off it might be set to 0 instead.Additonally you might be able to use the following in your script:[code]// enable url fopenini_set("allow_url_fopen", "On");[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13134-enabling-url-file-access/#findComment-50544 Share on other sites More sharing options...
clarencek Posted June 28, 2006 Author Share Posted June 28, 2006 [!--quoteo(post=388972:date=Jun 28 2006, 02:37 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 28 2006, 02:37 PM) [snapback]388972[/snapback][/div][div class=\'quotemain\'][!--quotec--]You said you had access to your php.ini? You just open it up and find the line that says [i]allow_url_fopen = Off[/i] to [i]allow_url_fopen = On[/i]It may not state Off it might be set to 0 instead.Additonally you might be able to use the following in your script:[code]// enable url fopenini_set("allow_url_fopen", "On");[/code][/quote]So, the code in the script did not work. I don't have access to the php.ini file, but they allow you to make a custom one. In my custom one, can I just have that one line stating "allow_url_fopen = On"? Or does it need to include a bunch of other stuff? Quote Link to comment https://forums.phpfreaks.com/topic/13134-enabling-url-file-access/#findComment-50563 Share on other sites More sharing options...
wildteen88 Posted June 28, 2006 Share Posted June 28, 2006 You can just put this in your customer php.ini:allow_url_fopen = OnIt may work, it may not. I would expect godaddy probably limits what settings you can changes in your custom php.ini Quote Link to comment https://forums.phpfreaks.com/topic/13134-enabling-url-file-access/#findComment-50564 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.