PHP error log and newline chars

前端 未结 2 1169
天涯浪人
天涯浪人 2020-12-09 17:10

What\'s the PHP config setting which allows or prevents newlines in debug output from being escaped?

On two different installs (a dev laptop running MAMP/OSX, and a

相关标签:
2条回答
  • 2020-12-09 17:49

    Chris, you should be able to change the error_log directive in your php.ini on Debian to point to a file. If this is undefined, it will go through syslog which doesn't support multiple lines.

    Details:

    error_log function

    error_log directive

    0 讨论(0)
  • 2020-12-09 18:11

    The problem is caused when the Apache process can't write into the error_log file, so the syslog writes into the file instead. The syslog messes up the line breaks.

    So just do:

    chmod 777 error.log
    

    This should solve your problem.

    0 讨论(0)
提交回复
热议问题