<?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>Stuff and Nonsense &#187; php</title>
	<atom:link href="http://blog.lesgray.co.uk/tags/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lesgray.co.uk</link>
	<description>Observations, rants and raves.</description>
	<lastBuildDate>Sat, 30 Jul 2011 20:39:51 +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>WordPress Suddenly Slow &#8211; Check your DNS resolution</title>
		<link>http://blog.lesgray.co.uk/2008/11/wordpress-suddenly-slow-check-your-dns-resolution/</link>
		<comments>http://blog.lesgray.co.uk/2008/11/wordpress-suddenly-slow-check-your-dns-resolution/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 21:45:09 +0000</pubDate>
		<dc:creator>Les</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Slowness]]></category>

		<guid isPermaLink="false">http://blog.lesgray.co.uk/?p=84</guid>
		<description><![CDATA[So, in recent weeks I have &#8220;discovered&#8221; and enthusiastically embraced WordPress. I&#8217;m now hosting several blogs. But a couple of days ago I setup a new blog. Same apache config as the others, same server, same WordPress version, no themes &#8230; <a href="http://blog.lesgray.co.uk/2008/11/wordpress-suddenly-slow-check-your-dns-resolution/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, in recent weeks I have &#8220;discovered&#8221; and enthusiastically embraced WordPress. I&#8217;m now hosting several blogs. But a couple of days ago I setup a new blog. Same apache config as the others, same server, same WordPress version, no themes or plugins, an absolute virgin install.</p>
<p>It worked. But man alive it was slow. I mean S L O O O O O W. Any page took at least 12 seconds (<em>actually almost exactly 12 seconds longer than the login page for example was loading on the other blogs. Comparable pages between fast blogs and slow blog were 12 seconds slower on the duff one</em>) to display (even the login page). Non-php resources such as css, js, images were all loading just as they did on the other blogs (which themselves continued to be speedy).</p>
<p>Anyway, to cut a long story search I Googled myself half to death and found many such reports but no real answers. Usual solution was plugins misbehaving but this didn&#8217;t apply to me or to many others suffering similar problems.</p>
<p>The problem for me turned out to be DNS. Yep, that simple. The blog was at blog.domain.com. My own machine resolved this address perfectly well (obviously since I could see the blog) but a server DNS issue meant that it wasn&#8217;t being resolved on the server (I have root access and was able to ping the domain name from the server itself and witness a failure.) And guess how long it took for a &#8220;ping blog.domain.com&#8221; to time out on the server? 12 seconds.</p>
<p>I sorted the DNS problem and bang, it speeded up just like the other sites. So, it would seem that somewhere in WordPress there is a DNS lookup being done, perhaps gethostbyname() upon the blogs own &#8220;name&#8221;. The blog and the admin etc work perfectly but a failed attempt at name resolution somewhere adds a constant to each page load. The actual duration will depend on individual server resolvers I guess.</p>
<p>This could easily explain some reported problems at various hosting companies. Working blogs suddenly take 30 to 40 seconds to load then time passes and they are ok again. I may venture a patch or a plugin to WordPress to &#8220;fix&#8221; or at least detect this situation. DNS servers do pack up occasionally or a server or LAN DNS server becomes unavailable. YOu wouldn&#8217;t expect WP to have to resolve its own host name but when it can&#8217;t you have a problem.</p>
<p>I&#8217;m off to do a find in files for &#8220;gethostbyname&#8221; and related functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lesgray.co.uk/2008/11/wordpress-suddenly-slow-check-your-dns-resolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t create TCP/IP socket (10106)</title>
		<link>http://blog.lesgray.co.uk/2008/11/cant-create-tcpip-socket-10106/</link>
		<comments>http://blog.lesgray.co.uk/2008/11/cant-create-tcpip-socket-10106/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 11:53:29 +0000</pubDate>
		<dc:creator>Les</dc:creator>
				<category><![CDATA[Windows Apache MySQL PHP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server 2003]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.lesgray.co.uk/?p=80</guid>
		<description><![CDATA[This post may help some other Windows/Apache/Mod-fcgid users out. We recently migrated a windows 2000 Apache install to a Windows Server 2003 box. Despite having all the mysql libs, the pho_sockets module etc configured php kept failing to connect to &#8230; <a href="http://blog.lesgray.co.uk/2008/11/cant-create-tcpip-socket-10106/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post may help some other Windows/Apache/Mod-fcgid users out.</p>
<p>We recently migrated a windows 2000 Apache install to a Windows Server 2003 box.</p>
<p>Despite having all the mysql libs, the pho_sockets module etc configured php kept failing to connect to a mysql localhost with the error &#8220;<strong>Can&#8217;t</strong> <strong>create</strong> <strong>TCP/IP</strong> <strong>socket</strong> <strong>(10106)</strong>&#8221;</p>
<p>After much googling and little answers (though many others having the same problem) I realised that in my httpd.conf in the section where we set runtime values for the PHP (such as PHP_RC, TEMP FOLDER etc.) included the path C:\WINNT which of course was fine on windows 200 but on Server 2003 should have been C:\WINDOWS.</p>
<p>Once all these paths were changed and apache started, all was well.</p>
<p>My guess is that php_sockets is dependent upon windows winsock implementation and with duff paths being passed to php-cgi.exe the winsock library could not be loaded and hence all socket stuff failed.</p>
<p>I&#8217;m only guessing though. Whatever the reason it&#8217;s unimportant since there was a clear problem with the paths.</p>
<p>Hope this saves someone else a couple of hours!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lesgray.co.uk/2008/11/cant-create-tcpip-socket-10106/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
