Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify a relative path to 'php_value error_log'

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.

like image 452
David Avatar asked Jul 04 '12 13:07

David


2 Answers

You can set it to ./path/error.log.

like image 100
jexact Avatar answered Nov 11 '22 00:11

jexact


When you have access to the server-config 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

like image 1
Radon8472 Avatar answered Nov 10 '22 23:11

Radon8472