Msg#: 3798295 posted 4:08 pm on Dec 2, 2008 (gmt 0)
This is a common question, I know, but I don't understand the solutions that always come up. I want to set the PHP path for an entire site, and never have to ever supply a relative or absolute path to include something, in case the includes path needs to change in future.
Using ini_set seems a bit chicken and egg to me... I would want the include path set before I do anything on my page, then include the header with simply include('header.php') and not worry about the path (same with all other includes from then on).
But if I have to put ini_set at the top of every page on my site, that defeats the point a little, considering I want a globally managed include path that I can set in one place. So then if I put the ini_set in a globally included file... how do I include it without a relative/absolute URL if ini_set has not yet happened?
Is there a solution that allows me to set the includes path somewhere for the entire site, without ever having to then specify include paths later? .htaccess perhaps?