A lesser known trick is that mod_php maps stderr to the Apache log. And, there is a stream for that,
so file_put_contents(‘php://stderr‘, print_r($foo, TRUE))
will nicely dump the value of ;
$foo
into the Apache error log.
转自: http://stackoverflow.com/questions/6079492/how-to-print-a-debug-log
时间: 2024-09-29 08:59:08