<?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>Tzvi's Web Development Blog &#187; php errors</title>
	<atom:link href="http://www.tzveeka.com/tag/php-errors/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tzveeka.com</link>
	<description>Inside the thoughts of a web company's CEO</description>
	<lastBuildDate>Sun, 18 Dec 2011 16:46:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PHP Can&#8217;t connect MySQL ? Here&#8217;s the fix</title>
		<link>http://www.tzveeka.com/php-cant-connect-mysql-heres-the-fix</link>
		<comments>http://www.tzveeka.com/php-cant-connect-mysql-heres-the-fix#comments</comments>
		<pubDate>Mon, 31 May 2010 09:53:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[About Me]]></category>
		<category><![CDATA[cant connect mysql]]></category>
		<category><![CDATA[mysql connection timeout]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php errors]]></category>
		<category><![CDATA[php mysql error]]></category>
		<category><![CDATA[vista localhost]]></category>

		<guid isPermaLink="false">http://www.tzveeka.com/?p=118</guid>
		<description><![CDATA[Hi, If you&#8217;re having problem connecting to your MySQL server within your PHP files and your PHP / MySQL / Apache are setup correctly, this post might solve your prblem. Reproducing the problem: When having a mysql_connect() statement within an executed PHP script &#8211; your browser will hang and after the php timeout (default is 60 seconds) pass this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tzveeka.com/wp-content/uploads/2010/05/windows-logo.jpg"><img class="alignleft size-full wp-image-120" title="windows-logo" src="http://www.tzveeka.com/wp-content/uploads/2010/05/windows-logo.jpg" alt="infected windows logo" width="222" height="196" /></a>Hi,</p>
<p>If you&#8217;re having problem connecting to your MySQL server within your PHP files and your PHP / MySQL / Apache are setup correctly, this post might solve your prblem.</p>
<p><strong>Reproducing the problem</strong>:</p>
<p>When having a mysql_connect() statement within an executed PHP script &#8211; your browser will hang and after the php timeout (default is 60 seconds) pass this error will be displayed in your browser window:</p>
<p><span style="color: #ff0000;">PHP Warning: mysqli::mysqli(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in xxx.php on line 2</span></p>
<p><span style="color: #ff0000;">PHP Warning: mysqli::mysqli(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.<br />
in xxx.php on line 2</span></p>
<p><span style="color: #000000;">I have spent all morning trying to setup my webserver on this new PC with Windows Vista, it seems like whatever was changed &#8211; PHP couldn&#8217;t connect to MySQL. </span></p>
<p><span style="color: #000000;">After thinking what might cause this problem since I have been installing webservers for years and this never happened &#8211; I looked into the root cause of the problem which was found to be my OS, Windows Vista (Argh!).</span></p>
<p>(The following info has been copied from <a href="http://coreygilmore.com/blog/2009/11/20/fix-php-5-3-hang-on-windows/" target="_blank">coreygilmore.com</a> &#8211; finding out this solution took a really long time)</p>
<p><a href="http://bugs.php.net/bug.php?id=45150">PHP bug #45150</a> suggests that this is due to issues resolving localhost on Windows. This is partially correct, more specifically it&#8217;s an issue with localhost resolving to ::1 when IPv6 is enabled.</p>
<p>While it feels like Windows has shoehorned in IPv6 support, the blame seems to lie with MySQL, which <a href="http://forge.mysql.com/worklog/task.php?id=798">won&#8217;t support IPv6 until version 6.0</a>.</p>
<p>I&#8217;m not sure why the timeout isn&#8217;t instant, the port is closed, so it could be partially a problem with PHP or Windows.</p>
<h3>The Fix</h3>
<p>Open up <code><span style="color: #ff0000;">%windir%\system32\drivers\etc\hosts</span></code> with a text editor and comment out the line that looks like:</p>
<pre><span style="color: #ff0000;">::1             localhost</span></pre>
<pre>Prefix it with a #, like so:</pre>
<pre>
<pre><span style="color: #ff0000;">#::1             localhost</span></pre>
</pre>
<p>Save it and your PHP/MySQL connections will immediately begin working. You could also use 127.0.0.1 in your connection string instead of localhost, but I didn&#8217;t want to change code in innumerable files.</p>
<p>If you have problem saving the document (this could be because of administrator rights or read only) just move the file to another directory (your desktop) modify it and copy it back to your etc directory.</p>
<p>Hope this solution helped,</p>
<p><strong>Resources :</strong></p>
<p>New to PHP? start learning PHP with <a href="http://4e8d5q3uk-r54ufcjh4fjmjh3b.hop.clickbank.net/" target="_blank">Robert Plank&#8217;s Easy PHP ebook</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tzveeka.com%2Fphp-cant-connect-mysql-heres-the-fix&amp;linkname=PHP%20Can%26%238217%3Bt%20connect%20MySQL%20%3F%20Here%26%238217%3Bs%20the%20fix">Share/Save/E-Mail this article</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tzveeka.com/php-cant-connect-mysql-heres-the-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When PHP gives you an empty white page instead of an error notice (QuickFix)</title>
		<link>http://www.tzveeka.com/when-php-gives-you-an-empty-white-page-instead-of-an-error-notice-quickfix</link>
		<comments>http://www.tzveeka.com/when-php-gives-you-an-empty-white-page-instead-of-an-error-notice-quickfix#comments</comments>
		<pubDate>Thu, 20 May 2010 09:11:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Developemt]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[error white page]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[php empty page]]></category>
		<category><![CDATA[php errors]]></category>
		<category><![CDATA[php parse errors]]></category>
		<category><![CDATA[php white page]]></category>
		<category><![CDATA[wamp php errors]]></category>

		<guid isPermaLink="false">http://www.tzveeka.com/?p=111</guid>
		<description><![CDATA[Hello folks, I have found out today that under my installation of PHP 5.3.0 on windows vista with WAMP &#8211; PHP just doesn&#8217;t want to report parse errors on my browser, even with error_reporting set to &#8220;on&#8221;. When parse errors occur PHP usually just prints out a blank white page without content or description of [...]]]></description>
			<content:encoded><![CDATA[<p>Hello folks,</p>
<p><a href="http://www.tzveeka.com/wp-content/uploads/2010/05/php-elephant.jpg"><img class="alignleft size-full wp-image-113" title="php elephant elephpant" src="http://www.tzveeka.com/wp-content/uploads/2010/05/php-elephant.jpg" alt="the php elephant or elephpant" width="188" height="217" /></a>I have found out today that under my installation of PHP 5.3.0 on windows vista with WAMP &#8211; PHP just doesn&#8217;t want to report parse errors on my browser, even with error_reporting set to &#8220;on&#8221;. When parse errors occur PHP usually just prints out a blank white page without content or description of the errors. (The errors can still be fetched using your web server&#8217;s log or by using a PHP syntax check application)</p>
<p>After doing some google searches it looks like other people have had this problem too. the only fix I found for this was to use wamp and just upgrade php to version 5.3.1 (The latest version available at this time).</p>
<p>Upgrading / Modifying your PHP version is really simple with WAMP:</p>
<p>Left click on the WAMP icon in your system tray, click on PHP -&gt; Version -&gt; Get More&#8230;<br />
WAMP&#8217;s upgrade page will pop up in your browser, just choose the latest php build or your current version (If you just want to reinstall) &#8211; open the downloaded file, install and you&#8217;re setup with a new version of PHP.</p>
<p>You might need to use the WAMP menu again to change the active version of  the PHP you&#8217;re using. everytime you change the php version with wamp&#8217;s menu&#8217;s it automatically edits all the INI files needed to run your webserver &#8211; like the php directory locaction in your httpd.conf (Apache webserver) file.</p>
<p>To change the active PHP version under wamp -&gt;<br />
Left click on the wamp icon in your system tray, click on PHP -&gt; Version -&gt; click on the version you want to be activated.</p>
<p>* The next time you execute WAMP it will remember your selection and will boot up with that version of php.</p>
<p><strong>Resources :</strong></p>
<p>New to PHP? start learning PHP with <a href="http://4e8d5q3uk-r54ufcjh4fjmjh3b.hop.clickbank.net/" target="_blank">Robert Plank&#8217;s Easy PHP ebook</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tzveeka.com%2Fwhen-php-gives-you-an-empty-white-page-instead-of-an-error-notice-quickfix&amp;linkname=When%20PHP%20gives%20you%20an%20empty%20white%20page%20instead%20of%20an%20error%20notice%20%28QuickFix%29">Share/Save/E-Mail this article</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tzveeka.com/when-php-gives-you-an-empty-white-page-instead-of-an-error-notice-quickfix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

