Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to output error messages from php

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces php how to output error tips, the article is very detailed, has a certain reference value, interested friends must read it!

Php output error prompt method: 1, open the corresponding PHP file; 2, add "error_reporting (E_ALL);"; 3, through the "function cache_shutdown_error () {...}" method output error information.

This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer

How does php output error messages?

Php output error message

Error_reporting (E_ALL); function cache_shutdown_error () {$_ error = error_get_last (); if ($_ error & & in_array ($_ error ['type'], array (1, 4, 16, 64, 256, 4096, E_ALL)) {header ("Content-Type: text/html; charset=utf-8"); echo' your code is wrong:' Echo 'fatal error:'. $_ error ['message']. ''; echo 'file:'. $_ error ['file']. ''; echo'in'. $_ error ['line']. 'OK';}} register_shutdown_function ("cache_shutdown_error")

It is best to put it at the front. If the error is terminated, this method cannot be executed.

The above is all the contents of the article "how to output error prompts from php". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report