View Full Version : best way to get installed directory

10-12-2012, 04:02 PM
Hi all,

I'm trying to build a project that I plan on making installable in the future, what i'm trying to do is find a way to get the directory that the app is installed in, I have a config page created and would like to set a variable in there that would store the apps root directory.

So lets say for example I want to include an image instead of writing the full value manually I want to be able to put $variable/images/image.png or something similar.

Thanks in advance

10-12-2012, 05:37 PM
PHP has a host of native directory functions for that. They are used by installable CMS' such as Wordpress...getcwd() will get the current directory of the script.

Check out http://php.net/manual/en/ref.dir.php for more directory functions