Reputation: 16726
Rather than put the absolute path to an error_log in my .htaccess, I would like to find a way to specify it relative to the .htaccess file (or similar):
php_value error_log %{DOCUMENT_ROOT}/libs/log/error/PHP_errors.log
It would be something like I would want to do, but this doesn't seem to work. If I specify the absolute, it does work.
Upvotes: 7
Views: 6198
Reputation: 4951
When you have access to the server-config httpd.conf
file, you can add the Line:
# set this to your document-root path
Define DOCROOT "d:\htdocs"
and in your htaccess you can write:
php_value error_log ${DOCROOT}/libs/log/error/PHP_errors.log
With this define you can even replace all other places where your document root is use e.g.
DocumentRoot "${DOCROOT}"
@see: https://httpd.apache.org/docs/2.4/de/mod/core.html#define
Upvotes: 2