"URL File-Access is disabled."

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by emiiya, Jan 31, 2010.

  1. emiiya

    emiiya New Member

    Messages:
    3
    Likes Received:
    0
    Trophy 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?
     
  2. Zubair

    Zubair Community Leader Community Support

    Messages:
    8,766
    Likes Received:
    305
    Trophy Points:
    83
    Post the line 2,3 and 4 of index.php here
     
    Last edited: Jan 31, 2010
  3. Gouri

    Gouri Community Paragon Community Support

    Messages:
    4,562
    Likes Received:
    245
    Trophy Points:
    63

    include of URL is may be disabled.

    use only

    PHP:
    include('/mainlayout.php'
    instead of full url
     
  4. xgreenberetx

    xgreenberetx New Member

    Messages:
    57
    Likes Received:
    1
    Trophy Points:
    0
    Make the header into a function, then make a template and were the header is, call your header function.
     
  5. emiiya

    emiiya New Member

    Messages:
    3
    Likes Received:
    0
    Trophy 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: Jan 31, 2010
  6. Gouri

    Gouri Community Paragon Community Support

    Messages:
    4,562
    Likes Received:
    245
    Trophy Points:
    63
    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: Jan 31, 2010
  7. emiiya

    emiiya New Member

    Messages:
    3
    Likes Received:
    0
    Trophy 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?
     
  8. Zubair

    Zubair Community Leader Community Support

    Messages:
    8,766
    Likes Received:
    305
    Trophy 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: Jan 31, 2010
  9. misson

    misson Community Paragon Community Support

    Messages:
    2,572
    Likes Received:
    72
    Trophy Points:
    48
    Last edited: Jan 31, 2010

Share This Page