<?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>Peeled Carrots &#187; wamp</title>
	<atom:link href="http://www.peeledcarrots.com/tag/wamp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peeledcarrots.com</link>
	<description>....cause life&#039;s too short to peel carrots. Enough said!!</description>
	<lastBuildDate>Tue, 03 Nov 2009 14:42:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wamp php fopen and fsockopen problem on vista</title>
		<link>http://www.peeledcarrots.com/wamp-php-fopen-and-fsockopen-problem-on-vista/</link>
		<comments>http://www.peeledcarrots.com/wamp-php-fopen-and-fsockopen-problem-on-vista/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 18:46:15 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[wamp]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.peeledcarrots.com/?p=217</guid>
		<description><![CDATA[I have finally found a solution to a fopen/fsockopen problem I was having on Vista using Wampserver&#8230;I know it&#8217;s not ideal to be developing on Windoze, but it&#8217;s my work machine so don&#8217;t crucify me  
I wanted to access a php file on my localhost using the following code: 
$fp = fopen("http://localhost/test/export.php", "r");
but got [...]]]></description>
			<content:encoded><![CDATA[<p>I have finally found a solution to a <strong>fopen/fsockopen</strong> problem I was having on Vista using <strong><a href="http://www.wampserver.com/">Wampserver</a></strong>&#8230;I know it&#8217;s not ideal to be developing on Windoze, but it&#8217;s my work machine so don&#8217;t crucify me <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I wanted to access a php file on my localhost using the following code: </p>
<p><code>$fp = fopen("http://localhost/test/export.php", "r");</code></p>
<p>but got a [function.fopen] php warning:</p>
<blockquote><p><strong>Warning</strong>: fopen(http://localhost/test/export.php) [function.fopen]: failed to open stream: 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. in C:\wamp\www\test\export.php on line 11</p></blockquote>
<p>I also tried adding &#8220;@&#8221; before the <strong>fopen</strong>, but still got the same php warnings</p>
<p><code>$fp = @fopen("http://localhost/test/export.php", "r");</code></p>
<p>So instead I tried <strong>fsockopen </strong>instead, but got another smiliar warning:</p>
<blockquote><p><strong>Warning</strong>: fsockopen() [function.fsockopen]: unable to connect to http://localhost/test/export.php (Unable to find the socket transport &#8220;http&#8221; &#8211; did you forget to enable it when you configured PHP?) in C:\wamp\www\test\export.php on line 11</p></blockquote>
<p><strong>Now for the solution:</strong></p>
<p>I came across a solution which worked for me on the <a href="http://www.wampserver.com/phorum/read.php?2,28291">wampserver forum</a>: </p>
<blockquote><p>I think I just found the solution here: <a href="http://bugs.php.net/bug.php?id=40287">bugs.php.net</a></p>
<p>It seems by changing &#8216;localhost&#8217; to &#8216;127.0.0.1&#8242; it works! </p></blockquote>
<p>So, changing the code to look like this actually works:</p>
<p><code>$fp = fopen("http://127.0.0.1/test/export.php", "r");</code></p>
<p>Strange, but true. Thanks to <a href="http://www.wampserver.com/phorum/profile.php?2,6192">anarchitecton</a>!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/wamp-php-fopen-and-fsockopen-problem-on-vista/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
