hhvm-fastcgi is not showing warnings
Asked Answered
Y

1

3

I'm using HHVM 3.1.0 (rel) with Nginx, and fastcgi is not showing warnings, but running hhvm on console it shows. Is it normal?

My php.ini:

error_reporting = E_ALL
display_errors = 1

hhvm.error_handling.call_user_handler_on_fatals = false
hhvm.error_handling.max_loop_count = 0
hhvm.error_handling.no_infinite_recursion_detection = false
hhvm.error_handling.throw_bad_type_exceptions = true
hhvm.error_handling.throw_too_many_arguments = true
hhvm.error_handling.warn_too_many_arguments = true
hhvm.error_handling.throw_missing_arguments = true
hhvm.error_handling.throw_invalid_arguments = true
hhvm.error_handling.enable_hip_hop_errors = true
hhvm.error_handling.notice_frequency = 1
hhvm.error_handling.warning_frequency = 1

hhvm.debug.full_backtrace = true
hhvm.debug.server_stack_trace = true
hhvm.debug.server_error_message = true
hhvm.debug.translate_source = true
Yaakov answered 15/6, 2014 at 16:49 Comment(0)
W
1

Well I had the same issue, stack question

After a lot of digging I found the problem. There is no error_handler set for HHVM. So you need to set your own.

I wrote a simple one that looks like the one of PHP, not complete though ie the error levels

set_error_handler(function ($errorNumber, $message, $errfile, $errline) {
    switch ($errorNumber) {
        case E_ERROR :
            $errorLevel = 'Error';
            break;

        case E_WARNING :
            $errorLevel = 'Warning';
            break;

        case E_NOTICE :
            $errorLevel = 'Notice';
            break;

        default :
            $errorLevel = 'Undefined';
    }

    echo '<br/><b>' . $errorLevel . '</b>: ' . $message . ' in <b>'.$errfile . '</b> on line <b>' . $errline . '</b><br/>';
});
Williamsen answered 3/7, 2014 at 10:16 Comment(1)
@Alex this answer is based on HHVM 3.1, not sure if you are using the same version. And everything is still the sameWilliamsen

© 2022 - 2024 — McMap. All rights reserved.