Re: include path file errors
| From: | John Hicks | Date: | Sat, 08 Apr 2006 16:21:07 +0000 |
| Subject: | Re: include path file errors | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233559@lists.php.net to get a copy of this message | ||
kmh496 wrote:
hi, my webroot is /a/b/current/ i am in /a/b/current/d/file.php file.php has a line require_once ($_SERVER[document_root]."/d/common.php"); common.php has a line which says require_once ($_SERVER[document_root]."/_common.php"); // main include file for whole site it sends me no errors about missing files, but the variables inside main include file _common.php are not set and don't exist in file.php where is my mistake? muchas gracias.KMH-- It's hard to say without seeing your code, but here are a few thoughts. Remember that "require_once" is conditional. A given file will only be included once for an entire response. (You might patch them from 'require_once' to 'require' to see if that makes a difference, although of course it may break something else.) You may need to do some basic trace debugging: i.e. inserting displays (echos to the output or error_log() entries) to trace exactly what is happening. Good luck! John