Re: Working directory of PHP pages?
| From: | Chris | Date: | Wed, 11 Mar 2009 01:15:03 +0000 |
| Subject: | Re: Working directory of PHP pages? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289815@lists.php.net to get a copy of this message | ||
Clancy wrote:
It is my understanding that when you open a page the PHP server looks for index.php in the site root directory, and loads it.The web server (not php) looks for an index.php file (if configured to do so) based on the path. http://www.example.com/subdir/folder/ will look in subdir/folder/ for an index file first. You can use mod_rewrite or something similar to point everything to http://www.example.com/index.php . As a result the working directory of the page will be
the root directory of the site. I have always worked on this assumption, and it has always been correct. On the other hand Stewart thinks that I cannot rely this, and am likely to get into trouble as a result.
Are there any systems in which my assumption will not be correct?Symlinked folders. You don't have the "real" working directory. -- Postgresql & php tutorials http://www.designmagick.com/