0

I'm running XAMPP on Windows 7. error_log("test") doesn't output to the my error_log specified in my vhost config (although the access log specified in the same config) does work.

Any ideas?

<VirtualHost *:80>
  DocumentRoot "c:\Users\User\Example"
  ServerName example.local

  CustomLog "C:\Users\User\Program\logs\local_access.log" combined
  ErrorLog "C:\Users\User\Program\logs\local_error.log"

  <Directory "C:\Users\User\Program">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>
Kyle Cureau
  • 1,537
  • 3
  • 11
  • 15

1 Answers1

1

I don't use XAMPP a lot, but a quick look at the included php.ini file (php/php.ini) shows that error_log (the path to the log file, not the function used log an error) is set (to php/logs/php_error.log).

Having this value set would override the default error logging behaviour, and log to the specified file instead of sending the error to mod_php/Apache.

As per the documentation:

error_log string

Name of the file where script errors should be logged. The file should be writable by the web server's user. If the special value syslog is used, the errors are sent to the system logger instead. On Unix, this means syslog(3) and on Windows NT it means the event log. The system logger is not supported on Windows 95. See also: syslog(). If this directive is not set, errors are sent to the SAPI error logger. For example, it is an error log in Apache or stderr in CLI.

cyberx86
  • 20,805
  • 1
  • 62
  • 81