CodeIgniter Forums
Is there a simple way to disable Kint and XDebug? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Is there a simple way to disable Kint and XDebug? (/showthread.php?tid=77124)



Is there a simple way to disable Kint and XDebug? - John_Betong - 07-21-2020

I find there is information overload rendered when CI4 encounters an error and I prefer to use PHP error reporting. Usually fix the first error and the rest disappear.

I did find that when CI_DEBUG  is false Kint is disabled  also the app/Config/Boot/ files can ensure Kint is never enabled.

I have searched and unable to find a simple way to disable CI4 XDebug error reporting.


RE: Is there a simple way to disable Kint and XDebug? - jreklund - 07-22-2020

XDebug are something that needs to disable within PHP itself if I recall correctly.


RE: Is there a simple way to disable Kint and XDebug? - John_Betong - 07-22-2020

Found it Smile

Add the following to app/Views/errors/html/error_exception.php

PHP Code:
<?php // ADD TO SHOW PHP LOG FILE
  
$logFile '../writable/logs/log-' .date('Y-m-d') .'.log';
  if( 
$tmp file_exists($logFile) ) :
    
$tmp print_rfile_get_contents($logfile), TRUE );
      echo 
'<h2>'.__file__  .'</h2>';
      echo 
'<pre>' .$tmp .'</pre>';
    die;
  endif;

// ORIGINAL error_exception.php contents below

?>
<?php $error_id 
uniqid('error'true); ?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="robots" content="noindex">
...
...
...