Here’s a little trick to log PHP errors to syslog from an apache chroot. Instead of creating a
$CHROOT/dev/log socket in the chroot and configuring syslog to listen on that, just define a bogus virtual host that logs to syslog.
<VirtualHost 127.0.0.2:80> ServerName JustForOpeningSyslog Redirect permanent / http://127.0.0.1/ ErrorLog syslog </VirtualHost>
Now apache calls
LOG_NDELAY before being chrooted by libapache2-mod-chroot, and libapache2-mod-php4’s
syslog(3) calls work just fine.
(Idea stolen from syslog(3) and chroot(2).)