Include without full hard coded path
Posted on 2005-04-23
I have the following include
I have to hard code the path, because the file that uses this include, is called from all sorts of folders. I thought I could just do the following:
which worked when calling the php files over the web in the normal way. But i have to call them from the command line as well via an exec call. When i try to run the page from a command line call (eg: "php myscript.php") the include line doesn't work unless i hard code the full path.
The reason why i can't hard code it, is that this entire application will be moved to various other home folders. I'd have to change the hard coded path each time I installed it in a new directory. I don't want to have to do that.
Anyone have any ideas of how I can do this?