Re: ini_set('include_path') and require_once()
| From: | Jim Grill | Date: | Thu, 26 Aug 2004 13:34:46 +0000 |
| Subject: | Re: ini_set('include_path') and require_once() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194782@lists.php.net to get a copy of this message | ||
The error message hints that something is wrong with your include path.
"(include_path='.:..')"
Also, when you say
ini_set("include_path", "../../php") you are
overwriting the entire include path rather than appending your path to it.
Try this:
<?php
echo get_include_path();
set_include_path(get_include_path() . ':/full/path/to/your/includes');
echo get_include_path();
?>
I would use the full system path rather than a relative path. Using "echo
get_include_path()" should give you an idea what's going on.
http://www.php.net/manual/en/function.set-include-path.php
Jim Grill
----- Original Message -----
From: "BigSmoke" <bigsmoke@nodiscipline.net>
To: <php-general@lists.php.net>
Sent: Thursday, August 26, 2004 6:56 AM
Subject: [PHP] ini_set('include_path') and require_once()
> Hi,
>
> In the following code, require_once() borks, complaining:
> "Failed opening required 'includes/companies.php'
> (include_path='.:..')"
>
> """
> ini_set("include_path", "../../php");
>
> require_once('includes/common.php');
> require_once('includes/validate.php');
> require_once('includes/company.php');
> require_once('includes/companies.php');
> """
>
> The strange thing is: I have other code where this same method _does_
> appear to work. Anyone care to enlighten me?
>
> I'm using PHP 4.3.8.
>
>
> BigSmoke
> Smokes your problems, coughs fresh air
>
> PS: I was not sure in which newsgroups to (cross-)post this.
> I thought, it might be better fit for php.version4, but, since
> I wasn't sure, I decided on php.general.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>