The MU forums have moved to WordPress.org

Weird Error When Including File (2 posts)

  1. rjmastey
    Member
    Posted 16 years ago #

    I have a php file I'm trying to add to every template. Rather than adding the code to each file, I'm just including it.

    When I drop the .php file in the template directory, it works fine. However, I wanted to keep it outside the template directory so I could edit just the one file. So, now the errors I'm getting are.

    1. URL file-access is disabled in the server configuration in
    2. failed to open stream: no suitable wrapper could be found in
    3. for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')

    When I use the absolute path, it works fine.

    Any idea why this would be happening?

  2. drmiketemp
    Member
    Posted 16 years ago #

    The webserver isn't allowing you to pull up other files via a URL. It's a security "feature."

    Best bet would be to put the file within the root of your install and use the absolute file path as an include.

About this Topic

  • Started 16 years ago by rjmastey
  • Latest reply from drmiketemp