PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

PHP snippet for extra debugging

<?php

// Debug - Add this on top of your index.php file

ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
    $error = error_get_last();
    echo("");
    print_r($error);
}

?>

If you've ever struggled to get your CMS like WordPress, Joomla, Magento or website display any errors, you will definitely find this snippet helpful.

I personally use this a lot and I would like to share this with more people.

Usage: Add this on top of your index.php file or the file that is not displaying any errors:

// Debug - Add this on top of your index.php file

ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
    $error = error_get_last();
    echo("");
    print_r($error);
}

Some CMSs come with built in debug mode, but in case your CMS doesn't offer that out of the box, you could simply use this snippet - it has helped me a lot!

BETA Snippet explanation automatically generated by OpenAI:

No explanation generated yet.

Snippet By Dev Dojo

ยท

Created June 12th, 2021

ยท

Report Snippet