Yikes I need help!
Moderator: General Moderators
Yikes I need help!
Help! I am getting an error message on my school's site that I can't find the problem to!
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /data/14/1/105/19/1268182/user/1353217/htdocs/public_html/scripts/right-column-long.php on line 4
Warning: include(http://www.oliverianschool.org/scripts/ ... member.php) [function.include]: failed to open stream: no suitable wrapper could be found in /data/14/1/105/19/1268182/user/1353217/htdocs/public_html/scripts/right-column-long.php on line 4
I've loaded old pages, I've looked over the code and can't find the problem to this ugly mess. Any suggestions?
Thanks!
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /data/14/1/105/19/1268182/user/1353217/htdocs/public_html/scripts/right-column-long.php on line 4
Warning: include(http://www.oliverianschool.org/scripts/ ... member.php) [function.include]: failed to open stream: no suitable wrapper could be found in /data/14/1/105/19/1268182/user/1353217/htdocs/public_html/scripts/right-column-long.php on line 4
I've loaded old pages, I've looked over the code and can't find the problem to this ugly mess. Any suggestions?
Thanks!
Re: Yikes I need help!
Change
to
Edit: This post was recovered from search engine cache.
Code: Select all
include('http://www.oliverianschool.org/scripts/dates-to-remember.php');Code: Select all
include('./dates-to-remember.php');
Last edited by McInfo on Thu Jun 17, 2010 4:54 pm, edited 1 time in total.
Re: Yikes I need help!
I didn't get an error when I went to that URL. I got the following output:
DATES TO REMEMBER
Weekend Activities
Winter Vacation
Friday, December 18 -
Monday, January 4
SAT Registration Deadline:
Feb. 4, 2010
ACT Registration Deadline:
March 5, 2010
DATES TO REMEMBER
Weekend Activities
Winter Vacation
Friday, December 18 -
Monday, January 4
SAT Registration Deadline:
Feb. 4, 2010
ACT Registration Deadline:
March 5, 2010
Re: Yikes I need help!
No errors for me either.
Looks OK from my end (Mac, Safari).
Looks OK from my end (Mac, Safari).
Re: Yikes I need help!
For future reference, this error occurred because one or both of allow_url_fopen and allow_url_include are disabled in php.ini.oliverian wrote:Warning: include() [function.include]: URL file-access is disabled in the server configuration
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 4:55 pm, edited 1 time in total.
Re: Yikes I need help!
I still haven't been able to fix it. Is it because I am using IE browser?
Re: Yikes I need help!
Your choice of browser has nothing to do with server errors.
In right-column-long.php, you need to change the include() on line 4 to point to a filesystem path instead of a URL.
Edit: This post was recovered from search engine cache.
In right-column-long.php, you need to change the include() on line 4 to point to a filesystem path instead of a URL.
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 4:55 pm, edited 1 time in total.
Re: Yikes I need help!
I tried changing the code on right-column-long to:
<?php
include "./dates-to-remember.php";
?>
Any ideas on what I am doing? Or at least can you explain it in layman's terms to me?
Thanks!
<?php
include "./dates-to-remember.php";
?>
Any ideas on what I am doing? Or at least can you explain it in layman's terms to me?
Thanks!
Re: Yikes I need help!
The "." in "./dates-to-remember.php" references the current directory. (Just for trivia, the parent directory would be "..".)
Assuming the current working directory is scripts, telling right-column-long.php to include "./dates-to-remember.php" should work. And it does if you access the script directly: http://www.oliverianschool.org/scripts/ ... n-long.php.
Apparently, that does not work for the index.php page, which has a different working directory.
You will need to use an absolute path...
...or one relative to index.php.
Of the two relative paths, the "./" path is preferred because it forces PHP to use the scripts folder in the current directory. With the other path, if there is no scripts folder, PHP will look for a scripts folder in the include_path.
Edit: This post was recovered from search engine cache.
Assuming the current working directory is scripts, telling right-column-long.php to include "./dates-to-remember.php" should work. And it does if you access the script directly: http://www.oliverianschool.org/scripts/ ... n-long.php.
Apparently, that does not work for the index.php page, which has a different working directory.
You will need to use an absolute path...
Code: Select all
include '/data/.../htdocs/public_html/scripts/dates-to-remember.php'; // (truncated)Code: Select all
include './scripts/dates-to-remember.php';Code: Select all
include 'scripts/dates-to-remember.php';Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 4:56 pm, edited 1 time in total.
Re: Yikes I need help!
Thank you so much McInfo, you got it to work! I used the relative path. Huge stress balloon just deflated in my head. One more question: Do you have any guesses as to why the website was working all along, and all of a sudden the path couldn't be found? I don't believe I have changes those files recently.
Thanks again!
Thanks again!
Re: Yikes I need help!
I'm not sure why I didn't think of this before... The best solution is to change the include() in right-column-long.php to
That is equivalent to PHP 5.3's
That way, the include() uses an absolute path that is the same whether right-column-long.php is included through index.php or accessed directly through the browser.
__FILE__ and __DIR__ are magic constants.
Edit: This post was recovered from search engine cache.
Code: Select all
include dirname(__FILE__) . '/dates-to-remember.php';Code: Select all
include __DIR__ . '/dates-to-remember.php';__FILE__ and __DIR__ are magic constants.
Someone probably changed the server configuration to disallow including URLs.oliverian wrote:Do you have any guesses as to why the website was working all along, and all of a sudden the path couldn't be found?
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 4:57 pm, edited 1 time in total.
Re: Yikes I need help!
Yes, that did work better as different pages in different directories share that same page. Thanks!