2012年3月13日 星期二

php 無法輸出正確的 content type 的設定方式

; PHP's built-in default is text/html
default_mimetype = "text/html"

如果, 沒有把 buffering=Off 註解掉, content-type 都只能輸出為 text/html, 無法使用 text/xml, 設定方式參考下列的值:
; 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 = Off
output_buffering = 4096

沒有留言:

張貼留言

Facebook 留言板