If you use some sort of application structure where everything is run from one (or more) controller script(s) in the root directory of the application installation, then you could get that installation root via :
$install_dir = dirname($_SERVER['SCRIPT_FILENAME']);
Or if you have some sort of common config/set-up file used by all the scripts, then you could explicitly define() the installation path there, having the user change it as part of the installation process, either manually or via an installation script.
So ultimately it will depend to some degree on your application design and your implementation and coding style as to what might work best for you.