"URL File-Access is disabled."

emiiya

New Member
Messages
3
Reaction score
0
Points
0
I have three errors:

Code:
Warning:  include() [[URL="http://midaevon.pcriot.com/function.include"]function.include[/URL]]: URL file-access is disabled in the server configuration in /home/emiiya/public_html/index.php on line 3

Warning:  include([URL]http://midaevon.pcriot.com/mainlayout.php[/URL]) [[URL="http://midaevon.pcriot.com/function.include"]function.include[/URL]]: failed to open stream: no suitable wrapper could be found in /home/emiiya/public_html/index.php on line 3

Warning:  include() [[URL="http://midaevon.pcriot.com/function.include"]function.include[/URL]]: Failed opening 'http://midaevon.pcriot.com/mainlayout.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/emiiya/public_html/index.php on line 3
On line 3 of index.php, I include a file called mainlayout.php, which is basically where the header and layout of the site are coded, all neatly in one file for easy access and changes.

I originally had a bookmarking system where it would fetch the URL, but after first googling this problem, I figured out that this wasn't allowed so I removed that chunk of code and just put $url="doesnt work yet" for the time being until I figure out another way to do this.

However, the problem still persists, and I'm stumped.

The scripts worked on another host, but here they don't seem to.

I can provide code if necessary, but first, any suggestions?
 

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
Post the line 2,3 and 4 of index.php here
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,564
Reaction score
245
Points
63
I have three errors:

Code:
Warning:  include() [[URL="http://midaevon.pcriot.com/function.include"]function.include[/URL]]: URL file-access is disabled in the server configuration in /home/emiiya/public_html/index.php on line 3

Warning:  include([URL]http://midaevon.pcriot.com/mainlayout.php[/URL]) [[URL="http://midaevon.pcriot.com/function.include"]function.include[/URL]]: failed to open stream: no suitable wrapper could be found in /home/emiiya/public_html/index.php on line 3

Warning:  include() [[URL="http://midaevon.pcriot.com/function.include"]function.include[/URL]]: Failed opening 'http://midaevon.pcriot.com/mainlayout.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/emiiya/public_html/index.php on line 3
On line 3 of index.php, I include a file called mainlayout.php, which is basically where the header and layout of the site are coded, all neatly in one file for easy access and changes.

I originally had a bookmarking system where it would fetch the URL, but after first googling this problem, I figured out that this wasn't allowed so I removed that chunk of code and just put $url="doesnt work yet" for the time being until I figure out another way to do this.

However, the problem still persists, and I'm stumped.

The scripts worked on another host, but here they don't seem to.

I can provide code if necessary, but first, any suggestions?


include of URL is may be disabled.

use only

PHP:
include('/mainlayout.php')

instead of full url
 

xgreenberetx

New Member
Messages
57
Reaction score
1
Points
0
Make the header into a function, then make a template and were the header is, call your header function.
 

emiiya

New Member
Messages
3
Reaction score
0
Points
0
First few lines of index:

PHP:
<?
$title="Midaevon || Home";
include("http://midaevon.pcriot.com/mainlayout.php");
?>

(the title is for something else later in the code, it has nothing to do with the include)

I tried /mainlayout.php, and the first error went away, however the second two remained.

Warning: include(/mainlayout.php) [function.include]: failed to open stream: No such file or directory in /home/emiiya/public_html/index.php on line 3

Warning: include() [function.include]: Failed opening '/mainlayout.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/emiiya/public_html/index.php on line 3
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,564
Reaction score
245
Points
63
First few lines of index:

PHP:
<?
$title="Midaevon || Home";
include("http://midaevon.pcriot.com/mainlayout.php");
?>

(the title is for something else later in the code, it has nothing to do with the include)

I tried /mainlayout.php, and the first error went away, however the second two remained.

Warning: include(/mainlayout.php) [function.include]: failed to open stream: No such file or directory in /home/emiiya/public_html/index.php on line 3

Warning: include() [function.include]: Failed opening '/mainlayout.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/emiiya/public_html/index.php on line 3

the server is linux. So check the filename . It is case sensitive. mainlayout.php is different to MainLayout.php

Check the file mainlayout.php is in public_html
 
Last edited:

emiiya

New Member
Messages
3
Reaction score
0
Points
0
Everything's where it should be, and spelling is correct.

I tried include("mainlayout.php"); without the slash, and it worked for the most part (bringing up a bunch of new errors now but I'm pretty sure I can fix those now).

What should I do if I have other files in folders? Will include("../mainlayout.php"); work when I try to include it in folders or is there another method I should be using?
 

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
Try this:

PHP:
include("$_SERVER['DOCUMENT_ROOT']/mainlayout.php");

The file mainlayout.php should be in public_html folder to work this

also make sure the permission of file is set to 644
 
Last edited:
Top