我一直在玩HHVM配置文件,我還沒有能夠讓它向瀏覽器輸出任何致命錯誤。它顯示E_NOTICE和E_WARNING,但是當發生任何E_ERROR時,它將頁面留空並且錯誤只出現在HHVM日誌文件中。hhvm-fastcgi + nginx如何讓它在瀏覽器中顯示致命錯誤
有沒有辦法讓它在瀏覽器中顯示?
我HHVM配置文件是如下:
PidFile = /var/run/hhvm/pid
Log {
Level = Warning
AlwaysLogUnhandledExceptions = true
RuntimeErrorReportingLevel = 8191
UseLogFile = true
UseSyslog = false
File = /var/log/hhvm/error.log
InjectedStackTrace = false
NativeStackTrace = false
Access {
* {
File = /var/log/hhvm/access.log
Format = %h %l %u % t \"%r\" %>s %b
}
}
}
ErrorHandling {
CallUserHandlerOnFatals = true
NoInfiniteLoopDetection = false
NoInfiniteRecursionDetection = false
ThrowBadTypeExceptions = false
ThrowNotices = false
NoticeFrequency = 1 # 1 out of these many notices to log
WarningFrequency = 1 # 1 out of these many warnings to log
AssertActive = false
AssertWarning = false
}
Debug {
FullBacktrace = false
ServerStackTrace = false
ServerErrorMessage = false
TranslateSource = false
RecordInput = false
ClearInputOnSuccess = true
ProfilerOutputDir = /tmp
CoreDumpReport = true
CoreDumpReportDirectory = /tmp
}
Http {
DefaultTimeout = 30 # in seconds
SlowQueryThreshold = 5000 # in ms, log slow HTTP requests as errors
}
Mail {
SendmailPath = sendmail -t -i
ForceExtraParameters =
}
Preg {
BacktraceLimit = 100000
RecursionLimit = 100000
}
Repo {
Central {
Path = /var/log/hhvm/.hhvm.hhbc
}
}
Eval {
Jit = true
}
MySQL {
TypedResults = false
ReadOnly = false
ConnectTimeout = 2000 # in ms
ReadTimeout = 2000 # in ms
SlowQueryThreshold = 2000 # in ms, log slow queries as errors
KillOnTimeout = false
}
Nginx的:
location ~ \.php$ {
fastcgi_keep_conn on;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_read_timeout 900;
fastcgi_send_timeout 900;
fastcgi_intercept_errors off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
我也試圖與 調試{ FullBacktrace =真 ServerStackTrace =真 ServerErrorMessage =真 TranslateSource =真 } 即使一些信息顯示了__FILE__和__LINE__信息不顯示。 – Satake
PHP結束如何?你有沒有啓用顯示所有錯誤? – Sina
謝謝你的回覆。是的在PHP結束我有\t \t \t error_reporting(E_ALL);和ini_set('display_errors',1);.正如我所說,這只是E_ERROR,我沒有得到。 – Satake