AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

PHP error_reporting() Function


<< Previous Page
PHP delete element
Next Page >>
PHP GET and POST

PHP Tutorial » PHP error display

How do I report errors in PHP?

error_reporting — Sets which PHP errors are reported

error_reporting(?int $error_level = null): int

The error_reporting() function sets the error_reporting directive at runtime.

level Optional. Specifies the error-report level for the current script.

 

error_reporting() examples

Specify different error level reporting:

<?php

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);

// Report all PHP errors
error_reporting(E_ALL);

// Report all PHP errors
error_reporting(-1);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?>

 

Related subjects:
PHP syntax What is an array PHP variabl Array to comma separated

 

Tags: php error reporting off, error_reporting(0) in php, how to fix php error, display_errors, enable
How do I report errors in PHP?
How do I turn off PHP error reporting?
What is the role of error reporting in PHP?
Which one is the correct option for error reporting?

 

How do I report errors in PHP?

If you just see a blank page instead of an error reporting and you have no server access so you can't edit php configuration files like php.ini try this: - create a new file in which you include the faulty script:

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
include("file_with_errors.php");
?>

execute this file instead of the faulty script file

 

error_reporting()

The error_reporting() function specifies which errors are reported.
PHP has many levels of errors, and using this function sets that level for the current script.

 



php error reporting off, error_reporting(0) in php, how to fix php error, display_errors, enable
How do I report errors in PHP?
How do I turn off PHP error reporting?
What is the role of error reporting in PHP?
Which one is the correct option for error reporting?
PHP error_reporting() - php tutorial

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Home
PHP Introduction
PHP Install
PHP Syntax
PHP Variables
PHP Echo and Print
PHP Data Types
PHP String Function
PHP Constants
PHP Operator Types
PHP If Else and Elseif
PHP Switch
PHP While Loops
PHP Loop For Do Foreach
PHP Array
Convert Array to String
PHP Function
PHP GET and POST
PHP Date/Time Functions
PHP Login
PHP Delete Element
PHP eregi_replace()
PHP mysql_query()
PHP Errors to Display
PHP Loop For Do Foreach

PHP forms
PHP Form Example
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Upload Image, display, edit and delete i...
Login Form with Image background...
How to Create an Image with Transparent ...
Portfolio Gallery Website with filtering...
Simple pagination script PHP MySQLi...
Center Image in div...
Image Hover Overlay Fade...
Sticky image / element / div on scroll...
Responsive images...
Create rounded image in HTML CSS...
Add border around image...
Position Text Over an Image HTML CSS res...
Create a Slideshow Images Gallery...
Create a Sticky Sidebar...
Search bar using CSS HTML...
Shrink Navigation Menu on Scroll...
How to Create Accordion HTML Templates...
Dropdown menu in the navigation bar...
Responsive Top Navigation Bar with mobil...
Split horizontal navigation bar...