quick question?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Wed Jan 17, 2007 3:27 am    Post subject: quick question? Reply with quote

How do i enable URL file access? I was testing a script and when i loaded it it got this:

Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in S:\Abyss Web Server\htdocs\mini_test.php on line 2


Im asking because i plan to release a mini searhc function (which can be added to web sites with php and (someday) html)
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed Jan 17, 2007 12:02 pm    Post subject: Reply with quote

It is in the php.ini.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Jan 17, 2007 12:12 pm    Post subject: Re: quick question? Reply with quote

hc2995,

It seems that you're calling require_once() with a bad path (unless you have really called it using something like require_once("http://........") ).

What is the full line containing that call to require_once()?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Wed Jan 17, 2007 2:27 pm    Post subject: Re: quick question? Reply with quote

aprelium wrote:
hc2995,

It seems that you're calling require_once() with a bad path (unless you have really called it using something like require_once("http://........") ).

What is the full line containing that call to require_once()?


Its:

require_once("http://www.searchdw.com/mini_search.php");

Mini_search.php works (you cna try it if you like) but i get that "URL File access disabled" warning
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Jan 19, 2007 1:05 am    Post subject: Re: quick question? Reply with quote

hc2995 wrote:
require_once("http://www.searchdw.com/mini_search.php");


Why not referencing the file locally using its relative (or possible its) path? That's easier, faster, and does not require certain PHP extensions and settings as those required to fetch files from a HTTP/FTP URL.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Fri Jan 19, 2007 3:53 am    Post subject: Reply with quote

i did do that, but heres the delema:

i plan to release a mini searhc function (which can be added to web sites with php and (someday) html) but for it to work the way i have it setup it needs URL file access. It will be something likehow google has thier search thing, but they use javascript (.js) which i dont think i can convert my system to work with javascript.
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Jan 19, 2007 6:22 pm    Post subject: Reply with quote

hc2995,

Could you explain us why using require_once("http://....") in that case? To download a page, there are better ways and commands.

Regarding Google, their search engine does not use Javascript (at least when reading/indexing/searching pages).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Fri Jan 19, 2007 9:34 pm    Post subject: Reply with quote

aprelium wrote:
hc2995,

Could you explain us why using require_once("http://....") in that case? To download a page, there are better ways and commands.

Regarding Google, their search engine does not use Javascript (at least when reading/indexing/searching pages).


Well i need a script that can search my DB for results, i actually didnt mean to use require_once (dont ask me why i used it) im thinking i can use include(http://.......); correct?

In regards to google, i didnt mean the actual seraching, indexing, part (like if you go to www.google.com) but if you have one of those bars that you can intergrate into your site it has the extension .js (which i believe means javascript)


ANY way: the new lines read:

<?php
include("http://www.searchdw.com/mini_search.php");
?>

(that is the whole script)

When i go to http://www.searchdw.com/mini_test.php i get this (the entire page):

Warning: include() [function.include]: URL file-access is disabled in the server configuration in S:\Abyss Web Server\htdocs\mini_test.php on line 2

Warning: include(http://www.searchdw.com/mini_search.php) [function.include]: failed to open stream: no suitable wrapper could be found in S:\Abyss Web Server\htdocs\mini_test.php on line 2

Warning: include() [function.include]: Failed opening 'http://www.searchdw.com/mini_search.php' for inclusion (include_path='.;C:\php5\pear') in S:\Abyss Web Server\htdocs\mini_test.php on line 2
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Jan 20, 2007 3:19 pm    Post subject: Reply with quote

hc2995,

Require_once and include are very similar, that's why you get that error. What we still don't get is your idea to use a full URL in these commands.

If you check any popular PHP script, you'll notice that almost no one uses include/require_once with a full URL. They only use local file paths.

So if they have the script files inside the directory C:/sites/site1/htdocs/myscript, a file located in that directory which needs to include C:/sites/site1/htdocs/myscript/lib/functions.php will only need to use:

Code:
include("lib/functions.php");


As you can notice there is no need to use URLs.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Jan 20, 2007 6:55 pm    Post subject: Reply with quote

As an addition to that, its also slower to use a full URL since the domain has to be resolved, the file located through the php executable from the webserver, downloaded, temporaly stored, THEN included into the file.

Much easier to use local paths :-)
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group