No Error Log...XAMPP Virtual Host Config?

5,191

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.

Share:
5,191

Related videos on Youtube

Kyle Cureau
Author by

Kyle Cureau

Currently building crone.ai and hakeema. Reach me on Twitter

Updated on September 18, 2022

Comments

  • Kyle Cureau
    Kyle Cureau over 1 year

    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
    Kyle Cureau almost 12 years
    This is what it was! Thanks, now I have an error_log I go through :)