j0b0 Posted December 11, 2007 Share Posted December 11, 2007 Hi - I am very new to php and server side stuff but am trying to make my way through it. I am getting the following error: Warning: include() [function.include]: URL file-access is disabled in the server configuration My version of php is 5.2.4. allow_url_fopen is set to on - good allow_url_include is set to off - bad I have tried editing the main php.ini file to turn it on, then restart apache, but it stays off. I have tried turning it on locally in a php.ini file and/or .htaccess but it stays off. I have searched in c-panel and there is no setting anywhere, including rebuilding apache, to turn this on. I am sure its something simple, but its beyond my ability to research how to turn this on. I am not worried about securitiy issues as this is a simple information only site to display some RSS feeds. Any help would be appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/81140-solved-cannot-get-allow_url_include-to-turn-on/ Share on other sites More sharing options...
btherl Posted December 11, 2007 Share Posted December 11, 2007 You can use readfile() instead of include() (this is recommended in the php manual) Quote Link to comment https://forums.phpfreaks.com/topic/81140-solved-cannot-get-allow_url_include-to-turn-on/#findComment-411734 Share on other sites More sharing options...
PFMaBiSmAd Posted December 11, 2007 Share Posted December 11, 2007 Make sure the php.ini that you are changing is the one that php is using. Why are you attempting to include a file using a http request? When you do this, the file is parsed by php (assuming it has a .php extension) and you only include any content that is output by that file (even if the file is located on the same server where the script is that is including it.) You normally want and need to include files using a file system path. Quote Link to comment https://forums.phpfreaks.com/topic/81140-solved-cannot-get-allow_url_include-to-turn-on/#findComment-411844 Share on other sites More sharing options...
j0b0 Posted December 11, 2007 Author Share Posted December 11, 2007 The php.ini I edited was on the root, in the /etc directory which I think is the main one. Of course again I could be wrong there. I was using an older php 4.x and did not have this issue. Upgrading did it. I actually don't have a choice, there is a bunch of script I am using that dynamically pulls RSS feeds using php into the html of the site, and I cannot edit that code. I will check to make sure there is not another php.ini somewhere its grabbing. Thanks Chris Quote Link to comment https://forums.phpfreaks.com/topic/81140-solved-cannot-get-allow_url_include-to-turn-on/#findComment-411904 Share on other sites More sharing options...
j0b0 Posted December 11, 2007 Author Share Posted December 11, 2007 That did it - since I am winging it, I was editing the wrong php.ini file. Thankfully this board is chock full of past advice, as I did not know how to actually find out what php.ini apache was using. %> php -i | grep ini | grep Path did the trick. Thanks all for the help! Chris Quote Link to comment https://forums.phpfreaks.com/topic/81140-solved-cannot-get-allow_url_include-to-turn-on/#findComment-412058 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.