2012-08-31 92 views
-1

我有內容類型的PHP文件:錯誤檢查

header('Content-Type: image/jpeg'); 

此文件的偉大工程與我的本地主機,但是當我把它上傳到我的服務器時,它拒絕工作,所以我'試圖啓用錯誤檢查,但沒有錯誤顯示任何我猜的內容類型的原因,是否有這方面的工作:?

謝謝..

+3

註釋掉頭部聲明,看看是什麼導致它的錯誤信息 –

回答

0

而不必像

<?php 
header('Content-Type: image/jpeg'); 
func1(); 
func2(); 
func3(); 
imagejpeg(....) 

腳本的編寫腳本像

<?php 
func1(); 
func2(); 
func3(); 
if (noErrorCondition) { 
    header('Content-Type: image/jpeg'); 
    imagejpeg(....) 
} 

然後添加調試輸出需要 - 或者甚至ini_set('display_errors', true); error_reporting(E_ALL);(或維持眼睛在PHP的error.log