<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>php error handling - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/php-error-handling/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/php-error-handling/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Wed, 08 Sep 2021 11:44:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>php error handling - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/php-error-handling/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Explain about error handling in php ?</title>
		<link>https://www.wikitechy.com/interview-questions/php/explain-about-error-handling-in-php/</link>
					<comments>https://www.wikitechy.com/interview-questions/php/explain-about-error-handling-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 21 Jul 2021 13:14:32 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[3i Infotech Limited interview questions and answers]]></category>
		<category><![CDATA[Accel Frontline Ltd interview questions and answers]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[basic php errors or problems]]></category>
		<category><![CDATA[Brillio Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Cactus Communications interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[CSG International interview questions and answers]]></category>
		<category><![CDATA[Cybage interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[disable warning in php ini]]></category>
		<category><![CDATA[error handling in php]]></category>
		<category><![CDATA[error reporting php inierror_reporting(0) not working]]></category>
		<category><![CDATA[Harbinger Systems interview questions and answers]]></category>
		<category><![CDATA[how to display an error message on the form using php]]></category>
		<category><![CDATA[how to display error message in html using php]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Info Edge interview questions and answers]]></category>
		<category><![CDATA[Infogain interview questions and answers]]></category>
		<category><![CDATA[Maintec Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[Net Solutions interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[php 7 not showing errorsphp display_errors]]></category>
		<category><![CDATA[php display_errors]]></category>
		<category><![CDATA[PHP Error and Exception Handling]]></category>
		<category><![CDATA[php error handling]]></category>
		<category><![CDATA[PHP Error Handling and Logging]]></category>
		<category><![CDATA[php error handling best practices]]></category>
		<category><![CDATA[php error handling try catch]]></category>
		<category><![CDATA[php error handling tutorial]]></category>
		<category><![CDATA[php error meaning]]></category>
		<category><![CDATA[php error message]]></category>
		<category><![CDATA[php error message display]]></category>
		<category><![CDATA[php error messagephp error message display]]></category>
		<category><![CDATA[php error reporting not working]]></category>
		<category><![CDATA[php error()]]></category>
		<category><![CDATA[php error()php hide errors]]></category>
		<category><![CDATA[php mysql error handling]]></category>
		<category><![CDATA[php startup error]]></category>
		<category><![CDATA[php try catch fatal error]]></category>
		<category><![CDATA[php.ini display_errors]]></category>
		<category><![CDATA[Prokarma Softech Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Raqmiyat Information Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Sopra Steria interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[types of error in php]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[ValueLabs interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<category><![CDATA[yahoo interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=1144</guid>

					<description><![CDATA[Answer : Error handling is the process of catching errors...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="explain-about-error-handling-in-php" class="color-pink" style="text-align: justify;">Explain about error handling in php ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Error handling is the process of catching errors elevated from program and then taking correct action. If you would handle errors then the most common error checking methods given in PHP.
<ul>
<li>die() function</li>
<li>Custom errors and error triggers</li>
<li>Error reporting</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="die-function" class="color-green">die() function</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>To write the PHP program you should check all possible error condition before checking and take appropriate action when required.</li>
<li>The following example without having /tmp/test.xt file and with this file.</li>
</ul>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php<br/>   if(!file_exists(&quot;/tmp/test.txt&quot;)) {<br/>      die(&quot;File not found&quot;);<br/>   }else {<br/>      $file = fopen(&quot;/tmp/test.txt&quot;,&quot;r&quot;);<br/>      print &quot;Opend file sucessfully&quot;;<br/>   }<br/>   // Test of the code here.<br/>?&gt;</code></pre> </div>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="custom-errors-and-error-triggers" class="color-green">Custom errors and error triggers</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>We can write own function to handling any error. PHP provides a framework to define error handling function.</li>
<li>This function must be able to handle a minimum of two parameters (error level and error message) but can accept up to five parameters (optionally: file, line-number, and the error context)</li>
</ul>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="syntax">Syntax</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">error_function(error_level,error_message, error_file,error_line,error_context);</code></pre> </div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="error-reporting" class="color-green">Error reporting</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>These error report levels are the different types of error the user-defined error handler can be used.</li>
<li>The errors are .E_ERROR, E_WARNING, E_PARSE, E_NOTICE, E_CORE_ERROR, E_CORE_WARNING, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, E_STRICT, E_RECOVERABLE_ERROR, E_ALL</li>
<li>These all errors handle to using set_error_handler function.</li>
</ul>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php<br/>   error_reporting( E_ERROR );<br/>   <br/>   function handleError($errno, $errstr,$error_file,$error_line) {<br/>      echo &quot;&lt;b&gt;Error:&lt;/b&gt; [$errno] $errstr - $error_file:$error_line&quot;;<br/>      echo &quot;&lt;br /&gt;&quot;;<br/>      echo &quot;Terminating PHP Script&quot;;<br/>      <br/>      die();<br/>   }<br/>   <br/>   //set error handler<br/>   set_error_handler(&quot;handleError&quot;);<br/>   <br/>   //trigger error<br/>   myFunction();<br/>?&gt;</code></pre> </div></figure>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/php/explain-about-error-handling-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
