Re: require/include from a different directory
| From: | Tim Burden | Date: | Mon, 31 Mar 2003 07:45:34 +0000 |
| Subject: | Re: require/include from a different directory | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141680@lists.php.net to get a copy of this message | ||
The call to include() must be relative to one of the directories listed in
open_basedir, regardless of which file the call is made from.
Usually the dir mentioned in open_basedir is the docroot, so in your case
require "include/inc_file.php";
should work from any file, in any folder.
----- Original Message -----
From: "Greg Macek" <it-guy@mrichi.com>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Saturday, March 29, 2003 3:37 PM
Subject: Re: [PHP] require/include from a different directory
> It seems I have found my problem. It has to do with the files I'm trying
> to include. They also include other files and the directories it's
> trying to include files from aren't working. I've found a workaround for
> my situation for the time being. It's not pretty, but functional.
>
> On Sat, 2003-03-29 at 14:19, Greg Macek wrote:
> > Hi,
> >
> > I'm having a problem hopefully can be easily answered. I'm trying to
> > organize parts of my site into different directories so that they're all
> > not in the "main" folder so to speak; basically breaking out by what
> > part of the application it is. I also have an "include" folder for all
> > my main functions and such...
> >
> > / (main directory)
> > /include (global functions, includes)
> > /app_sect1
> > /app_sect2
> >
> > what I'm trying to do from /app_sect1 is include a file from the
> > "include" directory, but with little success. The line looks like this:
> >
> > require "../include/inc_file.php";
> >
> > But my page just doesn't work for me now.. any ideas what I'm missing?
> >
> > - Greg
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>