Apache Virtualhosts with PHP and custom logs - how to isolate PHP errors?

Posted by Repox on Server Fault See other posts from Server Fault or by Repox
Published on 2012-12-07T10:34:13Z Indexed on 2012/12/07 11:07 UTC
Read the original article Hit count: 163

Filed under:
|
|
|

I'm trying to setup a simple hosting enviroment for my application on an Ubuntu server.

I created a virtualhost like this:

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName www.example.com
        ServerAlias example.com

        DocumentRoot /home/owner/example.com/docs
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/owner/example.com/docs/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /home/owner/example.com/logs/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /home/owner/example.com/logs/access.log combined

        php_flag log_errors on
        php_value error_log /home/owner/example.com/logs/php-error.log

</VirtualHost>

Now, my problem is that PHP errors and warnings are thrown in the error.log - not the php-error.log as I was hoping.

How can achieve this?

© Server Fault or respective owner

Related posts about apache2

Related posts about ubuntu