Re: including files outside of document root

From: Date: Wed, 23 Jan 2008 21:19:45 +0000
Subject: Re: including files outside of document root
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-267939@lists.php.net to get a copy of this message
On Jan 23, 2008, at 2:42 PM, Richard Lynch wrote:
On Wed, January 23, 2008 8:37 am, Jason Pruim wrote:
On Jan 22, 2008, at 3:57 PM, Jason Pruim wrote:
Hi everyone,
#1. When including files outside of the webroot do you need to specify the entire path? Like for me, that would be something like: "/ volumes/raider/webserver/includes/projectname/includeme.php" or can I just stop at: "/webserver/includes/projectname/includeme.php"?
Neither. :-) Figure out how PHP's include_path feature works and use that. http://php.net/set_include_path You should use set_include_path to define what directory[ies] PHP should search, and then just do: include 'includeme.php';
Okay, so I have this mostly working now! if I put my ini_set("include_path", "blah/to/balh"); on each and every page. I know I could include a file that is in the document root which specified that, but I was wondering if I was missing something? Obviously other then changing the php.ini file?
-- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com

« previous php.general (#267939) next »