Detailed explanation on the use of WHOOPS PHP debugging library

黄舟
Release: 2023-03-16 13:24:01
Original
1723 people have browsed it

The following editor will bring you an article on the use of WHOOPS PHP debugging library. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look.

Whoops is an error capture and debugging PHP library suitable for PHP environments; whoops is very easy to use. It provides stackbased error capture and super beautiful error viewing. The test results are as follows

Installation steps (composer installation)

After the installation is completed, go to the current directory Create a new directory tools, create a new whoops.php in the tools directory, add the following code to register the monitoring class require


__DIR__."/../vendor/autoload.php";
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
Copy after login

Then you can test it, the code is as follows, and the test rendering is as above

The above is the detailed content of Detailed explanation on the use of WHOOPS PHP debugging library. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!