Re: Question about includes

From: Date: Tue, 24 Nov 2009 16:24:04 +0000
Subject: Re: Question about includes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-300067@lists.php.net to get a copy of this message
On Tue, Nov 24, 2009 at 6:22 AM, Al <news@ridersite.org> wrote: > This bothers since the current working directory is effectively where my > original script resides; is it not? If so, doesn't the "include Net/SMTP.php > on line 206" look for the path relative to it and not in > /home1/youstart/php/? When including a file with a relative path PHP starts at the beginning of the include_path and checks each directory until it finds the file or reaches the end of the list. In this case it will start with the current directory since you've got the . as the first entry in the include path. When using relative paths, it's relative to the script with the include statement. So if you have a script myscript.php that includes mail.php, that include will be relative to myscript.php. Then when you include smtp.php from mail.php, the relative path will be relative to mail.php, not myscript.php. It looks like you're using PEAR classes, but the pear directory isn't in the include path. Try adding that path to your include_path by editing your .htaccess or using ini_set(). HTH, Brady

« previous php.general (#300067) next »