hellonoko Posted December 29, 2007 Share Posted December 29, 2007 I am receiving this error: Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\www\idea\timer\timer.php on line 9 Line 9 of my code is: include "http://localhost/idea/dbconnect.php"; I checked my php.ini and allow_url_fopen is on. allow_url_fopen = On Am running WAMP. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/83533-solved-url-file-acess-errors-with-include-commands/ Share on other sites More sharing options...
trq Posted December 29, 2007 Share Posted December 29, 2007 Is allow_url_include also on? Have you restarted the server if you've made changes to the php.ini? Quote Link to comment https://forums.phpfreaks.com/topic/83533-solved-url-file-acess-errors-with-include-commands/#findComment-425021 Share on other sites More sharing options...
hellonoko Posted December 29, 2007 Author Share Posted December 29, 2007 allow_url_include does not exist in my php.ini file. I did not make any changed it was always set to ON. And have restarted WAMP a couple times. Quote Link to comment https://forums.phpfreaks.com/topic/83533-solved-url-file-acess-errors-with-include-commands/#findComment-425025 Share on other sites More sharing options...
PFMaBiSmAd Posted December 29, 2007 Share Posted December 29, 2007 If you are including something like a database connection script using a http request and a URL - http://localhost/idea/dbconnect.php it won't work as that will only include any content that is output by dbconnect.php. If you want code and variables to be included, you need to include files using a file system path and not a http request. Quote Link to comment https://forums.phpfreaks.com/topic/83533-solved-url-file-acess-errors-with-include-commands/#findComment-425026 Share on other sites More sharing options...
ohdang888 Posted December 29, 2007 Share Posted December 29, 2007 its probably easier to just use "../" commands... those tell the script to look 1 folder back for it. put another one on and it will look back 2 directories... did i explain that right? Quote Link to comment https://forums.phpfreaks.com/topic/83533-solved-url-file-acess-errors-with-include-commands/#findComment-425028 Share on other sites More sharing options...
hellonoko Posted December 29, 2007 Author Share Posted December 29, 2007 I changed it to include "../dbconnect.php"; and it seems to work. That is what it was originally so I dunno... Quote Link to comment https://forums.phpfreaks.com/topic/83533-solved-url-file-acess-errors-with-include-commands/#findComment-425034 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.