Re: Include Problem

From: Date: Sun, 16 Apr 2006 00:11:48 +0000
Subject: Re: Include Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-234057@lists.php.net to get a copy of this message
At 8:03 PM +0100 4/15/06, Shaun wrote:
Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include("/cms/templates/footer.php"); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem?
With your code, I get the exact same error -- however, I don't have the file nor the correct path. So, I think you need to check the path. Try putting the following code in your footer.php and running it directly: print_r($_SERVER['SCRIPT_FILENAME']); That will tell you where the script is located. My guess is that you have a path error somewhere. hth's tedd -- -------------------------------------------------------------------------------- http://sperling.com

« previous php.general (#234057) next »