954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

URL file-access is disabled in the server configuration

Hi this is scorpionz.. i am facing a problem for the last 5 hours as
URL file-access is disabled in the server configuration

Description:
I have a project with path

c:/xampp/htdocs/mysite/config.php

Thats my configuration file name.

I have a folder in root which is getting connection
c:/xampp/htdocs/mysite/folder/testpage.php

now when I include my config.php to PHP file testpage.php
It gives the error:

c:/xampp/htdocs/mysite/config.php

Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\xampp\htdocs\mysite\utilities\testpage.php on line 2.

I am including the config in this way

<?php include 'http://'. $_SERVER['HTTP_HOST'] .'/config.php'; ?>

I am stuck to move..
Any response will be apprecited.
One more thing i am using drupal 6.

Regard
scorpionz

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

try:

include '../config.php';

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

Thanks for response back But

Warning: include_once(./includes/bootstrap.inc) [function.include-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\mysite\config.php on line 12

I got this error.
In fact config.php is present though.

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

This latest error looks as though you have an include error in the config module. Do you have an include for bootstrap.inc on line 12 of config.php?

chrishea
Nearly a Posting Virtuoso
1,428 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
 

Sounds like the old problem with folder navigation - relative vs.absolute, which may be further complicated by running on a local/test server. You have a file under the mysite/folder/ directory and this is including the main config file. Where is the include call for this new file coming from? The testpage itself or the config file.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

Well Thanks for your response back

To chrishea:
Drupal provides in own style of connecting to DB that is:

<?php

	include('./includes/bootstrap.inc');
	//include_once('./includes/bootstrap.inc');
	drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
	// Now you can run queries using db_query().
	$result = db_query('SELECT title FROM node');

?>

this file is bind with the name config.php and placed on root.
on the other side when i place my testpage.php file which has db queries on the root it easily connected to db and shows the results but when i placed on particular folder on the root, it shows an error.

To ardav :
Well your answer has bee quoted in way that config is a connection file and testpage is a result file. see the answer i provide to chrishea.

Thanks anyways, but i am stuck here.

Regards

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

if your config file is inside any other folder then use the path as

root dirctory/innerfolder/config.php

but if the config file is outer folder and the file in which u r including config like then use as
../folder/config.php

its just an exmple.

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

Well I have tried all the possibilities

I have now open the allow_url_include On
Now it seems to me drupal itself is not allowing to use its library within folder, but allowing to use when the files are on root.

So what to do ?
Is there any person of Drupal here?

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

Are you running this on localhost only? Do you get the same problem on a remote site? I've often had problems with localhosts myself. If you put everything under htdocs without the mysite folder, you'll probably find that it works. Unfortunately, that may not be possible. For an alternative - set up virtual hosts under windows - search this forum Airshow and I discussed it in a thread some time ago. What this does is give you a localhost url like: http:// mysite.local/ index.php.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

Hello ardav
sorry for late...
Thanks for responding
yes i am running on localhost, as u know we can change the system path at system32 so not a big deal.
coz i need to run apps to test before moving to online...
do u have an idea regarding drupal 6... and its folder structure?
coz i have an structure like this setup:

http://mysite/myfolder/test.php
http://mysite/config.php

now, how to map this config.php to test.php

the folder mysite is basically an installed drupal.

Kindly figured out this issue...

Thanks.

Regards
scorpionz.

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 


Darn. Sorry scorp, I can't help with your urls because I'm on holiday at the moment and am using my Blackberry. Also I don't have any experience with Drupal, just some experience with problems with localhost and the './' reference. But good luck with the problem.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

No problem ardav
But thanks for your cooperation anyways....

will wait for response from anyone with best of luck...

Regards
scorpionz.

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

Hi this is scorpionz.. i am facing a problem for the last 5 hours as URL file-access is disabled in the server configuration

Description: I have a project with path

c:/xampp/htdocs/mysite/config.php

Thats my configuration file name.

I have a folder in root which is getting connection c:/xampp/htdocs/mysite/folder/testpage.php

now when I include my config.php to PHP file testpage.php It gives the error:

c:/xampp/htdocs/mysite/config.php

Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\xampp\htdocs\mysite\utilities\testpage.php on line 2.

I am including the config in this way

<?php include 'http://'. $_SERVER['HTTP_HOST'] .'/config.php'; ?>

I am stuck to move.. Any response will be apprecited. One more thing i am using drupal 6.

Regard scorpionz


... I believe it's because allow_url_fopen is set to 0. Change it to 1 in either your php.ini or your httpd.conf. ...

rajesh4u2u
Newbie Poster
3 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You