PHP "Cannot modify header information - headers already sent by"

今天遇上這問題目前是順利解決來紀錄一下,稍微查了一下這可能是UTF8 dom的問題,也可能是buffer這部份的問題,總之我是用以下方是解決。

到"C:\Windows"找出php.ini將"output_buffering"修改為On
※O要大寫
; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit. You can enable output buffering during runtime by calling the output
; buffering functions. You can also enable output buffering for all files by
; setting this directive to On. If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = On


修改完後別忘了將apache重新啟動

沒有留言:

張貼留言