'How to use htaccess variable to set a php value dynamically?

I want to turn error logging on and the hosting suggests to use the error_log directive in the htaccess file for not choosing the default path and name.

My need is to create and set a dynamic filename by date like:

error_log_%{TIME_YEAR}-%{TIME_MON}-%{TIME_DAY}.txt

Despite the variables above are correct, the file created is the following:

error_log_%25{TIME_YEAR}-%25{TIME_MON}-%25{TIME_DAY}.txt

The code in the htaccess file is the following:

# log PHP errors to a file
php_flag log_errors on
php_value error_reporting 32767
php_value error_log /path/to/log/error_log_%{TIME_YEAR}-%{TIME_MON}-%{TIME_DAY}.txt

Is there a way to use these variables to use in a path dynamically?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source