php error/message logging

hey - first off, i am absolutely blown-away with virtualmin !

i am trying to determine where/how to log php messages. on my previous server, i would simply use a dot-htaccess file like so:

cat < ./.htaccess ;
php_flag log_errors on
php_value error_log /blah/blah/blah/marks-tester-log-using-htaccess.log
php_flag display_errors on
php_value error_reporting 6143

and this could be done in literally any directory the php script happens to be.

in virtualmin, i notice virtualmin creates a local php.ini file for me:


however, whenever i make any changes to php.ini, the apache server has to be restarted before the changes are recognized.

is there any way i can use dot-htaccess in addition to php.ini, or maybe even override php.ini using a dot-htaccess file?

my goal is really to be able to simply issue “error_log(‘mark is a nice guy’);” inside of any php script and be able to find it quickly.

thank you for helping this grateful newbie!


How did you go about installing Virtualmin – did you by chance use the script?

By default, Virtualmin stores logs for Apache/PHP in $HOME/logs/error_log.

Also, the default PHP Execution Mode is FCGID, which allows PHP code to be run as the Virtual Server owner’s username (as does CGI).

However, to be able to use “php_value” in a .htaccess file, you could only do that when using mod_php – that won’t work with FCGID or CGI.

You can switch between all those in Server Configuration -> Website Options.

As far as needing to restart Apache for new settings to take effect – if you’re using FCGID, it’s possible that old values are being temporarily cached, and that they’d change whenever that script is no longer being cached by Apache.