I’m working on a system that uses auto_prepend_file to include a global config file. I sometimes work in a different location, where the files are in a different place. Furthermore, I would like the project to be flexible, and easy to install in a directory structure of the user’s choice.
Therefore, I would to use the server variable DOCUMENT_ROOT in the php_value. Something like this;
I’m not sure why I was blind to the obvious two+ years ago but %{DOCUMENT_ROOT} is a “server internal” variable so $_SERVER[‘DOCUMENT_ROOT’] would be how PHP would access that value.
I know this is a wicked old thread, but it mislead me before, so here goes:
You cannot use a path relative to the DocumentRoot in an .htaccess file. However, you can use a file relative to the ServerRoot. This doesn’t really help the original poster, but hey, “Nope” is an answer too.
I don’t see what’s wrong with it - except that you could remove %{DOCUMENT_ROOT} with the same effect (and it would be more correct, i.e., have a better chance of working).