Hi, 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? Thanks, Simon ; 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 seconds 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
Simon Wheatley wrote:
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'm guessing no-one knew the answer to this one, or that I'm the only one with the problem? :) S
On Sep 14, 2007, at 10:42, Simon Wheatley wrote:
Simon Wheatley wrote:
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'm guessing no-one knew the answer to this one, or that I'm the only one with the problem? :)
I am the maintainer of php5 (along with jwa). I have received your question but have not had time to reproduce the problem or investigate a solution yet. I have been out of town without network access.
On 2007-09-21 , at 13:14 , Ryan Schmidt wrote:
I am the maintainer of php5 (along with jwa). I have received your question but have not had time to reproduce the problem or investigate a solution yet. I have been out of town without network access.
According to comments/notes found here http://us.php.net/manual/en/ref.errorfunc.php#49438 the error log that Apache wants to write to must be writable by the Apache user - www. If you change the ownership on this file error_log = /Users/simon/Library/Logs/php_error.log like chown www /Users/simon/Library/Logs/php_error.log and restart Apache errors *should* get written to that log file. Of course now you may have problems with CLI PHP writing to that file, but, well... Works for me php5 @5.2.4_0+apache+darwin_8+macosx+mysql5+pear (active) 8) ---------------------------------- Chris Janton - face at CentosPrime dot COM Netminder for Opus1.COM
Le 21 sept. 07 à 23:09, Chris Janton a écrit :
On 2007-09-21 , at 13:14 , Ryan Schmidt wrote:
I am the maintainer of php5 (along with jwa). I have received your question but have not had time to reproduce the problem or investigate a solution yet. I have been out of town without network access.
According to comments/notes found here
http://us.php.net/manual/en/ref.errorfunc.php#49438
the error log that Apache wants to write to must be writable by the Apache user - www.
If you change the ownership on this file
error_log = /Users/simon/Library/Logs/php_error.log
like
chown www /Users/simon/Library/Logs/php_error.log
and restart Apache errors *should* get written to that log file. Of course now you may have problems with CLI PHP writing to that file, but, well...
Works for me
php5 @5.2.4_0+apache+darwin_8+macosx+mysql5+pear (active)
8) ---------------------------------- Chris Janton - face at CentosPrime dot COM Netminder for Opus1.COM
From what I know, Apache modules will write log messages in Apache logs. -- Anthony Ramine, the infamous MacPorts Trac slave. nox@macports.org
participants (4)
-
Chris Janton
-
N_Ox
-
Ryan Schmidt
-
Simon Wheatley