apache overriding php's error_log setting

Bug #512167 reported by Daniel Convissor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: apache2

# less /etc/php5/php.ini
log_errors = true
error_log = /var/log/php_errors.log

# apache2ctl restart

View phpinfo() output, showing the log_errors and error_log settings are in place.

Create a PHP script that calls a bogus function then point a web browser at it.

# less /var/log/php_errors.log

The error isn't in there.

# less /var/log/apache2/error.log

Huh. The PHP error is in there. That's not how it's supposed to work.

Running Apache 2.2.12.

Revision history for this message
Chuck Short (zulcss) wrote :

Ok before we go any further we need the following:

- Which version of php are you using?
- Are you using php as a cgi or using mod_php?

Thanks
chuck

Changed in apache2 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Daniel Convissor (convissor) wrote :

This is happening with both PHP 5.3.2RC1 and a current checkout of the PHP_5_3 branch. Both built from source from SVN by me to run as Apache modules. Only one of them is installed at a time.

Apache is apache2-mpm-prefork installed via apt-get.

Revision history for this message
Daniel Convissor (convissor) wrote :

Never mind. Apache didn't have permissions to create the error log. Here's how to resolve it:

mkdir /var/log/php5
chown root:www-data /var/log/php5
chmod 775 /var/log/php5

Now edit php.ini:
error_log = /var/log/php5/php_errors.log

Sorry for the noise.

Changed in apache2 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.