<?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>fairul &#62; &#187; PHP</title>
	<atom:link href="http://www.fairul.org/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.fairul.org</link>
	<description>life, photography, marathon, triathlon</description>
	<lastBuildDate>Fri, 03 Feb 2012 09:12:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Display PHP errors when display_errors is Disabled</title>
		<link>http://www.fairul.org/2009/10/display-php-errors-when-display_errors-is-disabled?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=display-php-errors-when-display_errors-is-disabled</link>
		<comments>http://www.fairul.org/2009/10/display-php-errors-when-display_errors-is-disabled#comments</comments>
		<pubDate>Mon, 12 Oct 2009 03:02:20 +0000</pubDate>
		<dc:creator>fairul</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[errors]]></category>

		<guid isPermaLink="false">http://www.fairul.org/?p=348</guid>
		<description><![CDATA[There are some servers where the webmasters or server admin wants to make the server more secure, they will disable the display_errors on the PHP settings.
The php.ini will look like this:
{code type=php}; &#8211; display_errors = Off           [Security]
;     With this directive set to off, errors that  [...]]]></description>
			<content:encoded><![CDATA[<p>There are some servers where the webmasters or server admin wants to make the server more secure, they will disable the display_errors on the PHP settings.</p>
<p>The php.ini will look like this:</p>
<p>{code type=php}; &#8211; display_errors = Off           [Security]<br />
;     With this directive set to off, errors that occur during the execution of<br />
;     scripts will no longer be displayed as a part of the script output, and thus,<br />
;     will no longer be exposed to remote users.  With some errors, the error message<br />
;     content may expose information about your script, web server, or database<br />
;     server that may be exploitable for hacking.  Production sites should have this<br />
;     directive set to off.</p>
<p>Print out errors (as a part of the output).  For production web sites,<br />
; you&#8217;re strongly encouraged to turn this feature off, and use error logging<br />
; instead (see below).  Keeping display_errors enabled on a production web site<br />
; may reveal security information to end users, such as file paths on your Web<br />
; server, your database schema or other information.<br />
display_errors = On{/code}</p>
<p>During apps development, u will need to display the errors in order for u to debug the code easily, so u can track what&#8217;s the error was.</p>
<p>Add below code on top of your PHP code:</p>
<p>{code type=php}ini_set(&#8216;display_errors&#8217;, 1);<br />
ini_set(&#8216;log_errors&#8217;, 1);<br />
ini_set(&#8216;error_log&#8217;, dirname(__FILE__) . &#8216;/error_log.txt&#8217;);  // this is optional<br />
error_reporting(E_ALL);{/code}</p>
<p>Happy coding with PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fairul.org/2009/10/display-php-errors-when-display_errors-is-disabled/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

