How to edit the message ( Fatal error: Maximum Execution time of 30 Seconds exceeded )

Asked

Viewed 148 times

0

Every time there is a slowness in the server response this message is displayed, but it is not formatted and escapes the layout pattern of my application.

I wonder if it is possible to edit this message or treat it, like modify font color, things like.

1 answer

0

You cannot edit this message, but can capture fatal error using the functions register_shutdown_function and error_get_last and treat it differently.

<?php

function onShutdown() {
    $lastError = error_get_last();
    if ($error['type'] == E_ERROR) {
        // Retornar seu template com erro
    }
}

register_shutdown_function('onShutdown');

You will probably have to change your php.ini not to display errors with display_errors=0 also.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.