Forum Moderators: phranque

Message Too Old, No Replies

Setting PHP log ini values in Htaccess file

Relative PHP log paths?

         

thing3b

10:46 pm on May 30, 2007 (gmt 0)

10+ Year Member



I am trying to setup custom PHP logging on my hosted website. I do not have access to the main server configuration files.

Currently I have defined the following in my .htaccess file:


php_flag log_errors on
# php_flag display_errors off
php_value error_log /usr/home/username/public_html/Logs/php.txt
php_value error_reporting 2047

This works.
The problem is that this entire website is synchronised between development and production environments. In the development environment, the log file path is slightly different. Instead of:
/usr/home/username/public_html/Logs/php.txt
it is
C:\MyWebsites\public_html\Logs\php.txt
(Note: the slashes are not a problem)

So what I can not seem to do is have a log file relative to the htaccess file like so:


php_value error_log ./Logs/php.txt

Can anyone point me in the right direction as to how I can have a relative php log path set in an htaccess file?
OR
How I can find out and use the document root value when setting the php log file location?

coopster

3:27 am on Jun 13, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Can you do it in your script? That particular directive is of type PHP_INI_ALL which means it can be set anywhere, including a script.