<?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>Website Design Sheffield - Mark Goddard &#187; php.ini</title>
	<atom:link href="http://blog.0100.tv/tag/phpini/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.0100.tv</link>
	<description>Web Design &#38; Development blog</description>
	<lastBuildDate>Sat, 02 Oct 2010 09:47:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>php.ini and Undefined Variable errors</title>
		<link>http://blog.0100.tv/2009/03/phpini-and-undefined-variable-errors/</link>
		<comments>http://blog.0100.tv/2009/03/phpini-and-undefined-variable-errors/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 21:51:05 +0000</pubDate>
		<dc:creator>Mark Goddard</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[error_reporting]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.0100.tv/?p=201</guid>
		<description><![CDATA[It all started with a new server. After setting up and installation everything was working fine, until I read the error_log files in the servers logs. There were loads and loads of error messages reporting that there were &#8220;undefined variables&#8221; throughout every script on the server. Strange! It ended up being very easy to fix&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>It all started with a new server. After setting up and installation everything was working fine, until I read the error_log files in the servers logs.</p>
<p>There were loads and loads of error messages reporting that there were &#8220;undefined variables&#8221; throughout every script on the server. Strange!</p>
<p>It ended up being very easy to fix&#8230;<span id="more-201"></span></p>
<p>The errors displayed:</p>
<pre>[Thu Feb 19 14:35:37 2009] [error] [client xx.xx.94.2] PHP Notice:  Undefined variable: page2 in /xxx/xxx/xxx/0100.tv/httpdocs/xxx/xxx.php on line 3
[Thu Feb 19 14:35:37 2009] [error] [client xx.xx.94.2] PHP Notice:  Undefined variable: page3 in /xxx/xxx/xxx/0100.tv/httpdocs/xxx/xxx.php on line 4
[Thu Feb 19 14:35:37 2009] [error] [client xx.xx.94.2] PHP Notice:  Undefined variable: page4 in /xxx/xxx/xxx/0100.tv/httpdocs/xxx/xxx.php on line 5
[Thu Feb 19 14:35:37 2009] [error] [client xx.xx.94.2] PHP Notice:  Undefined variable: page5 in /xxx/xxx/xxx/0100.tv/httpdocs/xxx/xxx.php on line 6
[Thu Feb 19 14:35:37 2009] [error] [client xx.xx.94.2] PHP Notice:  Undefined variable: page6 in /xxx/xxx/xxx/0100.tv/httpdocs/xxx/xxx.php on line 8</pre>
<p>This was awfully confusing considering that every variable was working. However, it comes down to sloppy coding/PHP&#8217;s error reporting settings. You could define every variable by typing var $variable; before using it but that&#8217;s a silly idea. Instead&#8230;.</p>
<p>Reading through the error reporting description at the top of php.ini we read:</p>
<pre>By default, PHP surpresses errors of type E_NOTICE.  These error messages
    are emitted for non-critical errors, but that could be a symptom of a bigger
    problem.  Most notably, this will cause error messages about the use
    of <strong>uninitialized variables</strong> to be displayed.</pre>
<p>To stop there errors you can change error reporting php.ini by doing the following:</p>
<p>change</p>
<pre>error_reporting  =  E_ALL</pre>
<p>to</p>
<pre>error_reporting = E_ALL &amp; ~E_NOTICE</pre>
<p>This will then only show the relevant error messages and supresses non-critical errors. Sorted.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.0100.tv/2009/03/phpini-and-undefined-variable-errors/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

