Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Log fatal errors using <code>register_shutdown_function</code>, which requires PHP 5.2+:</p> <pre><code>register_shutdown_function( "fatal_handler" ); function fatal_handler() { $errfile = "unknown file"; $errstr = "shutdown"; $errno = E_CORE_ERROR; $errline = 0; $error = error_get_last(); if( $error !== NULL) { $errno = $error["type"]; $errfile = $error["file"]; $errline = $error["line"]; $errstr = $error["message"]; error_mail(format_error( $errno, $errstr, $errfile, $errline)); } } </code></pre> <p>You will have to define the <code>error_mail</code> and <code>format_error</code> functions. For example:</p> <pre class="lang-php prettyprint-override"><code>function format_error( $errno, $errstr, $errfile, $errline ) { $trace = print_r( debug_backtrace( false ), true ); $content = " &lt;table&gt; &lt;thead&gt;&lt;th&gt;Item&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th&gt;Error&lt;/th&gt; &lt;td&gt;&lt;pre&gt;$errstr&lt;/pre&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th&gt;Errno&lt;/th&gt; &lt;td&gt;&lt;pre&gt;$errno&lt;/pre&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th&gt;File&lt;/th&gt; &lt;td&gt;$errfile&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th&gt;Line&lt;/th&gt; &lt;td&gt;$errline&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th&gt;Trace&lt;/th&gt; &lt;td&gt;&lt;pre&gt;$trace&lt;/pre&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;"; return $content; } </code></pre> <p>Use <a href="http://swiftmailer.org/" rel="noreferrer">Swift Mailer</a> to write the <code>error_mail</code> function.</p> <p>See also:</p> <ul> <li><a href="http://php.net/manual/en/reserved.variables.phperrormsg.php" rel="noreferrer">http://php.net/manual/en/reserved.variables.phperrormsg.php</a></li> <li><a href="http://php.net/manual/en/errorfunc.constants.php" rel="noreferrer">http://php.net/manual/en/errorfunc.constants.php</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload