php_error.log is always empty

  • Hello everybody,

    i have the following issue: with standard configuration as well as with my own configuration error.log or self-configured php_error.log is always empty, even if i force some erros that should be logged.

    PHP runs as cgi program.

    My logfile (manually created) can be found in


    Php.inis are configured as follows:


    1. Log_errors = Onerror_log = /var/www/virtual/[myDomain.tld]/logs/[sub.MyDomain.tld]/php_error.log


    1. Log_errors = Onerror_log = "{HOME_DIR}/logs/php_error.log"


    1. Log_errors = On
    2. error_log = "{HOME_DIR}/logs/php_error.log"

    I don't know if i am completly wrong with my configuration, but that's what i've found in other threads here but nothing of these solutions actually worked.

    • Can anyone help, please? ?(
  • For me it looks wrong. You must save your logs under /var/logs/php/sub.domain.tld/error.log and then mount them into your customers log-folder.

  • But standard-log-file was empty, too.

    Which php.ini do i have to change?

    How to mount in my custom log-Folder? Just copy it?

  • Which implementation you're using? fpm, itk or fcgi?

  • I'm not sure but please also test with conf-files under /etc/php5/
    Also try to use /var/log/php5/sub.domain.tld/error.log (or something like that) as log-path..

  • Alright, thanks for it. I think I've got it. The logfile /var/log/apache2/sub.domain.tld/php_error.log is written, only if I give access-level '666' (public write rights). I just want to give 664 or just 644). But which user is trying to write in error case? I tried "www-data", but that didn't work? Is there another user to give access to that logfile?