+ Reply to Thread
Results 1 to 9 of 9

Thread: "URL File-Access is disabled."

  1. #1
    emiiya is offline x10Hosting Member emiiya is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    3

    "URL File-Access is disabled."

    I have three errors:

    Code:
    Warning:  include() [function.include]: URL file-access is disabled in the server configuration in /home/emiiya/public_html/index.php on line 3
    
    Warning:  include(http://midaevon.pcriot.com/mainlayout.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/emiiya/public_html/index.php on line 3
    
    Warning:  include() [function.include]: 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. #2
    Zubair's Avatar
    Zubair is offline x10 Super Spammer Zubair has a reputation beyond reputeZubair has a reputation beyond reputeZubair has a reputation beyond repute
    Join Date
    Jul 2009
    Location
    Pakistan
    Posts
    8,747

    Re: "URL File-Access is disabled."

    Post the line 2,3 and 4 of index.php here
    Last edited by Zubair; 01-31-2010 at 09:51 AM.
    Zubair Barkat | Level 2 Tech
    █ 888-X10-9668 - zubair[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004

  3. #3
    Gouri's Avatar
    Gouri is offline Community Paragon Gouri has a brilliant futureGouri has a brilliant futureGouri has a brilliant future
    Join Date
    Oct 2007
    Location
    India
    Posts
    4,502

    Re: "URL File-Access is disabled."

    Quote Originally Posted by emiiya View Post
    I have three errors:

    Code:
    Warning:  include() [function.include]: URL file-access is disabled in the server configuration in /home/emiiya/public_html/index.php on line 3
    
    Warning:  include(http://midaevon.pcriot.com/mainlayout.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/emiiya/public_html/index.php on line 3
    
    Warning:  include() [function.include]: 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 Code:
    include('/mainlayout.php'
    instead of full url
    If you feel my post is useful then click to give Reputation (bottom left corner of this post)

    X10 Hosting | News and Announcements | Premium Hosting | VPS Hosting | Prime Membership

    Tech Community | Gouri

  4. #4
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: "URL File-Access is disabled."

    Make the header into a function, then make a template and were the header is, call your header function.

  5. #5
    emiiya is offline x10Hosting Member emiiya is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    3

    Re: "URL File-Access is disabled."

    First few lines of index:

    PHP Code:
    <?
    $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 by emiiya; 01-31-2010 at 10:06 AM.

  6. #6
    Gouri's Avatar
    Gouri is offline Community Paragon Gouri has a brilliant futureGouri has a brilliant futureGouri has a brilliant future
    Join Date
    Oct 2007
    Location
    India
    Posts
    4,502

    Re: "URL File-Access is disabled."

    Quote Originally Posted by emiiya View Post
    First few lines of index:

    PHP Code:
    <?
    $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 by Gouri; 01-31-2010 at 10:08 AM.
    If you feel my post is useful then click to give Reputation (bottom left corner of this post)

    X10 Hosting | News and Announcements | Premium Hosting | VPS Hosting | Prime Membership

    Tech Community | Gouri

  7. #7
    emiiya is offline x10Hosting Member emiiya is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    3

    Re: "URL File-Access is disabled."

    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. #8
    Zubair's Avatar
    Zubair is offline x10 Super Spammer Zubair has a reputation beyond reputeZubair has a reputation beyond reputeZubair has a reputation beyond repute
    Join Date
    Jul 2009
    Location
    Pakistan
    Posts
    8,747

    Re: "URL File-Access is disabled."

    Try this:

    PHP Code:
    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 by Zubair; 01-31-2010 at 10:24 AM.
    Zubair Barkat | Level 2 Tech
    █ 888-X10-9668 - zubair[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004

  9. #9
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: "URL File-Access is disabled."

    To make include-ing from arbitrary directories easier, use set_include_path. Read "RE: php include - above root directory" for details.
    Last edited by misson; 01-31-2010 at 05:10 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Securing your PHP file upload scripts.
    By slacker3 in forum Tutorials
    Replies: 2
    Last Post: 12-05-2009, 11:44 AM
  2. i cant access my site, not displaying index file
    By charitymadurai in forum Free Hosting
    Replies: 3
    Last Post: 07-06-2009, 12:35 PM
  3. filezilla help
    By monsterm in forum Free Hosting
    Replies: 10
    Last Post: 06-25-2009, 01:14 PM
  4. Server Time-Zone To Local Time-Zone
    By rockee in forum Tutorials
    Replies: 4
    Last Post: 06-02-2008, 09:58 AM
  5. help!!
    By retro-bliss in forum Free Hosting
    Replies: 25
    Last Post: 12-07-2007, 01:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers