Re: including files outside of document root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux