PHP logging to Apache error log

Simon Wheatley lists at
Tue Sep 11 01:56:56 PDT 2007


I've installed Apache and PHP through MacPorts. Everything is good, 
except that PHP won't log to its own error log when running through 
Apache. (When run through the CLI it logs to its own error log as expected.)

I've amended the php.ini at /opt/local/etc/php.ini to add the error_log 
value, see below for my full php.ini file.

I attempted to trace the error_log value from a PHP file being run 
through Apache, with the following:
  error_log( ini_get(error_log) );
Which logs "/Users/simon/Library/Logs/php_error.log"... in the Apache 
error log!

Is there any way I can force PHP to log into its own separate log?



; PHP ini file

engine = On
short_open_tag = On
precision    =  14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
allow_call_time_pass_reference = Off
safe_mode = Off
expose_php = Off ; security
; Important security thing!
allow_url_fopen = Off ; Prevent include($url) and the like

max_execution_time = 30     ; Maximum execution time of each script, in 
memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)

error_reporting  =  E_ALL
display_errors = On
display_startup_errors = Off
log_errors = On
track_errors = Off
error_log = /Users/simon/Library/Logs/php_error.log
register_globals = Off
register_argc_argv = Off
post_max_size = 8M
magic_quotes_gpc = Off
magic_quotes_runtime = Off

More information about the macports-users mailing list