[MacPorts] #17839: php5: Newlines showing as "\n" in Apache error log

MacPorts noreply at macports.org
Wed Jan 28 15:16:40 PST 2009


#17839: php5: Newlines showing as "\n" in Apache error log
----------------------------------------+-----------------------------------
  Reporter:  simon@…                    |       Owner:  ryandesign@…             
      Type:  defect                     |      Status:  closed                   
  Priority:  Normal                     |   Milestone:  Port Bugs                
 Component:  ports                      |     Version:  1.7.0                    
Resolution:  invalid                    |    Keywords:  php5, error log, newlines
      Port:  php5                       |  
----------------------------------------+-----------------------------------

Comment(by simon@…):

 Replying to [comment:5 ryandesign@…]:

 Thank you for your reply. Unfortunately it has highlighted that the
 problem is not where I thought it was. My PHP config '''does''' specify an
 error_log location, but the errors are '''still''' written to the Apache
 log regardless.

 To illustrate, when I run this code:

 {{{
 $my_array = array( 'blue', 'red', 'orange', 'apple' );

 error_log( print_r( $my_array, true ) );

 error_log( ini_get( 'error_log' ) );
 }}}


 I see the following in my '''Apache''' log:

 {{{
 [Wed Jan 28 23:03:47 2009] [error] [client 192.168.0.1] Array\n(\n    [0]
 => blue\n    [1] => red\n    [2] => orange\n    [3] => apple\n)\n
 [Wed Jan 28 23:03:47 2009] [error] [client 192.168.0.1]
 /Users/simon/Library/Logs/php.log
  }}}

 Note the second error line, which claims the error logging is set to a
 different location. Unfortunately there is no logging happening at this
 location (although something was appended to the correct file last
 November, so something somewhere at sometime was using the php.log file).

 I'll attach a PDF of the output of phpinfo() on the same page, which shows
 the php.ini file should be being read from /opt/local/etc/php.ini. I'll
 also attach that php.ini for good measure, I have error_log set as
 /Users/simon/Library/Logs/php.log, but there is no output in that file
 since November 2008. (Running phpinfo() on PHP on the commandline gives
 the same output, as far as the loaded php.ini and the error_log location
 goes.)

 I've reopened the ticket, I hope that's OK, please let me know if you'd
 rather I started a new one, with a more accurate description.

-- 
Ticket URL: <http://trac.macports.org/ticket/17839#comment:6>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list