View previous topic :: View next topic |
Author |
Message |
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Wed Jan 17, 2007 3:27 am Post subject: quick question? |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Jan 17, 2007 12:02 pm Post subject: |
|
|
It is in the php.ini. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Jan 17, 2007 12:12 pm Post subject: Re: quick question? |
|
|
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 |
|
 |
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Wed Jan 17, 2007 2:27 pm Post subject: Re: quick question? |
|
|
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 |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Jan 19, 2007 1:05 am Post subject: Re: quick question? |
|
|
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 |
|
 |
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Fri Jan 19, 2007 3:53 am Post subject: |
|
|
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 |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Jan 19, 2007 6:22 pm Post subject: |
|
|
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 |
|
 |
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Fri Jan 19, 2007 9:34 pm Post subject: |
|
|
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 |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jan 20, 2007 3:19 pm Post subject: |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sat Jan 20, 2007 6:55 pm Post subject: |
|
|
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 |
|
 |
|