<?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>K-Squared Ramblings &#187; php</title>
	<atom:link href="http://www.hyperborea.org/journal/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hyperborea.org/journal</link>
	<description>Sci-fi, comics, humor, photos...it&#039;s all fair game.</description>
	<lastBuildDate>Sat, 21 Nov 2009 07:49:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='www.hyperborea.org' port='80' path='/journal/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>What’s Dynamic About It?</title>
		<link>http://www.hyperborea.org/journal/archives/2008/03/14/whats-dynamic/</link>
		<comments>http://www.hyperborea.org/journal/archives/2008/03/14/whats-dynamic/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 03:22:35 +0000</pubDate>
		<dc:creator>Kelson</dc:creator>
				<category><![CDATA[Comics]]></category>
		<category><![CDATA[Site Updates]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.hyperborea.org/journal/archives/2008/03/14/whats-dynamic/</guid>
		<description><![CDATA[In my post on Webslices, I mentioned that the home page of my Flash site uses server-side includes instead of a static HTML file.  But it doesn&#8217;t really update that often: maybe 3 or 4 times a month.  Is it really worth building that file dynamically?  Should I switch from SSI to [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.hyperborea.org/journal/archives/2008/03/13/webslices-and-microsummaries/">post on Webslices</a>, I mentioned that the home page of my <a href="http://www.hyperborea.org/flash/">Flash site</a> uses server-side includes instead of a static HTML file.  But it doesn&#8217;t really update that often: maybe 3 or 4 times a month.  Is it really worth building that file dynamically?  Should I switch from SSI to something more powerful, like PHP, that will let me add headers so that repeat visitors won&#8217;t have to re-download the whole page except when it&#8217;s <em>actually different</em>?  Or should I switch to a static file, with the same benefits but simpler?  <strong>What am I actually building, anyway?</strong></p>
<p>Looking through the code, I find:</p>
<p><strong>Browser upgrade banners.</strong>  People using old versions of Firefox (currently 1.5 or older) or Internet Explorer (currently 5.5 or older) get an &#8220;Upgrade to Firefox&nbsp;2&#8243; banner instead of the thumbnail of the current issue of the comic.  This is just as easily done with JavaScript&#8212;and <em>is</em> done with JS elsewhere on the site.  (I used to make some minor adjustments for other versions of IE, but I converted them all to <a href="http://www.quirksmode.org/css/condcom.html">conditional comments</a> a while back.)</p>
<p><strong>Last-modified date</strong> in the footer, pulled from the actual file.  I&#8217;ve already got a script to update this in the static files, so it&#8217;s just a matter of adding it to my general update script.  A two-minute, one-time change and I&#8217;ll never notice the difference.</p>
<p><strong>Latest posts from this blog.</strong>  Probably better done with an iframe, or maybe using AJAX.  Drawback: either method would mean an extra request from the client.  On the plus side, repeat visitors would be able to re-use the rest of the page, and only download the 5-item list.</p>
<p><strong>Unique-per-day spamtrap addresses</strong>, hidden where harvesters might pick them up.  But only a few of them still accept mail and feed it to filters.  Mostly, they just waste spammers&#8217; resources.  I could easily either get rid of them or change the script to generate a new address with each update instead of each day.</p>
<p>So really, there isn&#8217;t much stopping me from using a static file for the most-viewed page on the site, with all the attendant savings in system resources, bandwidth, etc.</p>
<p>On the other hand, I keep contemplating switching to a database-driven system for the whole thing, which would make any changes now meaningless.  But since I&#8217;ve been thinking about that since around 2000 or so, and haven&#8217;t changed it yet, that&#8217;s not exactly a blocker!</p>
<p><b>Update (March 30):</b> I&#8217;ve made the conversion to a static file.  The blog posts and browser upgrade banners are now done client-side (and run after the rest of the page is loaded), the last-modified date is part of the pre-processing script, and I just removed the daily spamtrap addresses.  Now to see whether it actually improves performance.</p>
<hr /><small>Copyright &copy; 2009 Kelson Vibber and/or Katherine Foreman.<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. Permission granted to Planet Antispam and LiveJournal syndication feed ksquaredramblin.  If this content is not in your news reader or one of the sites listed above, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint: bc1c453a98ff79bab5c4fca2d890469d (38.107.191.94) )</small> <a href="http://www.hudson-family.co.uk/extremecorticate.php?source=673"></a>]]></content:encoded>
			<wfw:commentRss>http://www.hyperborea.org/journal/archives/2008/03/14/whats-dynamic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Patch&#8230;Friday?</title>
		<link>http://www.hyperborea.org/journal/archives/2007/09/07/patch-friday/</link>
		<comments>http://www.hyperborea.org/journal/archives/2007/09/07/patch-friday/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 06:28:27 +0000</pubDate>
		<dc:creator>Kelson</dc:creator>
				<category><![CDATA[Site Updates]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.hyperborea.org/journal/archives/2007/09/07/patch-friday/</guid>
		<description><![CDATA[I suppose it&#8217;s best to release the security fixes when they&#8217;re ready, because any time you pick is going to be inconvenient for someone, but lately it seems like Friday is suddenly in style.
Last Friday saw the release of PHP 5.2.4, on the Friday before&#8212;in the US, anyway&#8212;a 3-day weekend.  This morning Apache released [...]]]></description>
			<content:encoded><![CDATA[<p>I suppose it&#8217;s best to release the security fixes when they&#8217;re ready, because any time you pick is going to be inconvenient for <em>someone</em>, but lately it seems like Friday is suddenly in style.</p>
<p>Last Friday saw the release of <a href="http://www.php.net/releases/5_2_4.php">PHP 5.2.4</a>, on the Friday before&#8212;in the US, anyway&#8212;a 3-day weekend.  This morning <a href="http://httpd.apache.org/">Apache</a> released security updates for all three supported branches of their webserver.  And this evening&#8212;yes, Friday evening&#8212;<a href="http://wordpress.org/development/2007/09/wordpress-223/">WordPress 2.2.3 came out</a>.</p>
<p>Which reminds me, I&#8217;m going to have to start looking at the betas for <a href="http://wordpress.org/development/2007/09/wordpress-23-beta-2/">WordPress 2.3</a>.  I think it&#8217;ll be a good time for a redesign.  Maybe pick a new theme and tweak that one, maybe try my hand at actually designing one.  I wonder if the new tagging system can import <a href="http://plugins.trac.wordpress.org/wiki/BunnysTechnoratiTags">Bunny&#8217;s Technorati Tags</a>.</p>
<hr /><small>Copyright &copy; 2009 Kelson Vibber and/or Katherine Foreman.<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. Permission granted to Planet Antispam and LiveJournal syndication feed ksquaredramblin.  If this content is not in your news reader or one of the sites listed above, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint: bc1c453a98ff79bab5c4fca2d890469d (38.107.191.94) )</small> <a href="http://www.hudson-family.co.uk/extremecorticate.php?source=673"></a>]]></content:encoded>
			<wfw:commentRss>http://www.hyperborea.org/journal/archives/2007/09/07/patch-friday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automattic Stats, or PHP 5.2.2 vs. WordPress XMLRPC</title>
		<link>http://www.hyperborea.org/journal/archives/2007/05/07/automattic-stats/</link>
		<comments>http://www.hyperborea.org/journal/archives/2007/05/07/automattic-stats/#comments</comments>
		<pubDate>Mon, 07 May 2007 16:45:18 +0000</pubDate>
		<dc:creator>Kelson</dc:creator>
				<category><![CDATA[Site Updates]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[automattic]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.hyperborea.org/journal/archives/2007/05/07/automattic-stats/</guid>
		<description><![CDATA[Experimenting with the new Automattic Stats Plugin that uses the WordPress.com statistics infrastructure to track traffic.  So far, so good&#8230; except for one problem.  Titles and links are missing from all the &#8220;most visited&#8221; posts.  They&#8217;re just listed as numeric IDs.
Update: Actually, today&#8217;s posts seem OK.  The plugin seems to just [...]]]></description>
			<content:encoded><![CDATA[<p>Experimenting with the <a href="http://wordpress.com/blog/2007/05/06/stats-plugin/">new</a> <a href="http://andy.wordpress.com/2007/05/05/automattic-stats-for-self-hosted-wordpress/">Automattic Stats Plugin</a> that uses the <a href="http://wordpress.com/">WordPress.com</a> statistics infrastructure to track traffic.  So far, so good&#8230; except for one problem.  Titles and links are missing from all the &#8220;most visited&#8221; posts.  They&#8217;re just listed as numeric IDs.</p>
<p><b>Update:</b> Actually, today&#8217;s posts seem OK.  The plugin seems to just send the blog ID and post ID.  I&#8217;ve been trying to figure out how the central server is retrieving the permalink and title.  It doesn&#8217;t look like <a href="http://www.bad-behavior.ioerror.us/">Bad Behavior</a> is blocking it.  And it doesn&#8217;t seem to be using the RSS feed, since posts that are still on the front page (and presumably still in the feed) are also showing up as numbers. *grumble*</p>
<p><b>Update 2:</b> I just noticed that all of the number-only posts show the same placeholder graph showing &#8220;Region A&#8221; vs. &#8220;Region B&#8221; for 2003-2005.</p>
<p><b>Update 3:</b> It&#8217;s a problem with WordPress&#8217; XMLRPC interface, and affects other uses (like connecting with Flock).  I&#8217;ve got a workaround, though (see comments).</p>
<p><b>Update 4 (May 10):</b> Thanks to the pingback below from <i>dot unplanned</i>, it&#8217;s confirmed to be a <a href="http://bugs.php.net/bug.php?id=41293">bug in PHP 5.2.2</a>.  With any luck, the workaround will cease to be necessary when the next PHP bugfix is released.</p>
<hr /><small>Copyright &copy; 2009 Kelson Vibber and/or Katherine Foreman.<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. Permission granted to Planet Antispam and LiveJournal syndication feed ksquaredramblin.  If this content is not in your news reader or one of the sites listed above, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint: bc1c453a98ff79bab5c4fca2d890469d (38.107.191.94) )</small> <a href="http://www.hudson-family.co.uk/extremecorticate.php?source=673"></a>]]></content:encoded>
			<wfw:commentRss>http://www.hyperborea.org/journal/archives/2007/05/07/automattic-stats/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>WordPress Broken on PHP 5.2 Again</title>
		<link>http://www.hyperborea.org/journal/archives/2007/02/21/wp-php52/</link>
		<comments>http://www.hyperborea.org/journal/archives/2007/02/21/wp-php52/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 18:30:18 +0000</pubDate>
		<dc:creator>Kelson</dc:creator>
				<category><![CDATA[Annoyances]]></category>
		<category><![CDATA[Site Updates]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.hyperborea.org/journal/archives/2007/02/21/wp-php52/</guid>
		<description><![CDATA[Upgraded to WordPress 2.1.1.  Supposedly should&#8217;ve fixed the PHP 5.2 problems.  In reality, they&#8217;re worse unchanged.  Bug 3354 is marked fixed, but it seems to have only been fixed on the 2.0 series. 
After fixing it manually&#8212;again&#8212;I&#8217;m still getting broken pages and seeing this in the error logs:
PHP Fatal error:  Call [...]]]></description>
			<content:encoded><![CDATA[<p>Upgraded to <a href="http://wordpress.org/development/2007/02/new-releases/">WordPress 2.1.1</a>.  Supposedly should&#8217;ve fixed the PHP 5.2 problems.  In reality, they&#8217;re <del>worse</del> <ins>unchanged</ins>.  <a href="http://core.trac.wordpress.org/ticket/3354">Bug 3354</a> is marked fixed, but it seems to have only been fixed on the 2.0 series. <span id="more-1596"></span></p>
<p>After fixing it manually&#8212;again&#8212;I&#8217;m still getting broken pages and seeing this in the error logs:</p>
<blockquote><p>PHP Fatal error:  Call to a member function get_row() on a non-object in /path/to/wp-includes/functions.php on line 211</p></blockquote>
<p>Is it just my imagination, or does no one at WordPress actually test it with current versions of PHP?</p>
<p><b>Update:</b> Switched back to WordPress 2.1 and it&#8217;s working again.</p>
<p><b>Update 2:</b> For some reason, diffing a plain 2.1 against a plain 2.1.1, then applying the patch to my site, seems to have resulted in a working site, even though uploading the new files and manually fixing things didn&#8217;t.  Presumably I have another manual fix in there that I didn&#8217;t label.</p>
<p><b>Update 3:</b> I&#8217;ve re-uploaded the new files, which resulted (as expected) in a broken site with the fatal PHP errors on get() in cache.php on line 32.  So I re-applied the manual fixes from that bug which wasn&#8217;t actually fixed in 2.1.1.  And now it seems to be working.</p>
<p>I&#8217;m still seeing the errors on get_row() in functions.php, but they don&#8217;t seem to be associated with broken pages.  A little further digging and they seem to have started on Monday, with the upgrade to PHP 5.2.1.  Spot checking the error times against the access log suggests it&#8217;s only happening with hits from bots, so there may be something going on with Bad Behavior. <b>Update 4:</b> Strike that, it just happened on the preview for this post.  GRRRR.</p>
<p><b>Update 5: Found the problem!</b>  I&#8217;d forgotten the <em>other</em> change I made on Monday, which was to enable WordPress&#8217; internal cache in wp-config.php:</p>
<blockquote><p>define(&#8217;ENABLE_CACHE&#8217;, true );</p></blockquote>
<p>That explains why it would seem to work at first, and then stop working.  At first, WordPress would be pulling info from the database, but then it would start pulling it from the cache instead&#8230; and something about the way that functionality works doesn&#8217;t agree with PHP 5.2.  The first instance of the error coincides closely with the timestamp on the config file.</p>
<p>So the old fix still works&#8230;unless you&#8217;re using WordPress&#8217; internal data cache.</p>
<p><b>Update 6:</b> On a related note, I tried <a href="http://blog.saddey.net/2007/02/18/how-to-prevent-wpcache-from-changing-a-feeds-content-type-to-text-html/">Reiner Saddey&#8217;s fix</a> for getting WP-Cache to remember the content-type on feeds, but it had the same problem my fix did, which was to break conditional gets (it would send a full 200 OK response, with the entire feed, instead of just a 304 Not Modified code).  And with something that gets requested as often as a feed, you really want conditional gets to work.</p>
<hr /><small>Copyright &copy; 2009 Kelson Vibber and/or Katherine Foreman.<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. Permission granted to Planet Antispam and LiveJournal syndication feed ksquaredramblin.  If this content is not in your news reader or one of the sites listed above, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint: bc1c453a98ff79bab5c4fca2d890469d (38.107.191.94) )</small> <a href="http://www.hudson-family.co.uk/extremecorticate.php?source=673"></a>]]></content:encoded>
			<wfw:commentRss>http://www.hyperborea.org/journal/archives/2007/02/21/wp-php52/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Upgrade</title>
		<link>http://www.hyperborea.org/journal/archives/2006/01/16/php-upgrade/</link>
		<comments>http://www.hyperborea.org/journal/archives/2006/01/16/php-upgrade/#comments</comments>
		<pubDate>Tue, 17 Jan 2006 00:10:01 +0000</pubDate>
		<dc:creator>Kelson</dc:creator>
				<category><![CDATA[Site Updates]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.hyperborea.org/journal/archives/2006/01/16/php-upgrade/</guid>
		<description><![CDATA[I&#8217;ve upgraded the server to PHP 5.  As with last week&#8217;s MySQL upgrade, if anything seems broken, please comment about it here. If you can’t comment, email me at webmaster at this domain name.
Update: It looks like something in my setup disagrees with the combination of PHP 5 and WP-Cache 2.  Pages were [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve upgraded the server to <a href="http://www.php.net/">PHP 5</a>.  As with last week&#8217;s <a href="http://www.hyperborea.org/journal/archives/2006/01/10/mysql-upgrade/">MySQL upgrade</a>, if anything seems broken, please comment about it here. If you can’t comment, email me at webmaster at this domain name.</p>
<p><b>Update:</b> It looks like something in my setup disagrees with the combination of PHP 5 and <a href="http://mnm.uib.es/gallir/wp-cache-2/">WP-Cache 2</a>.  Pages were turning up blank the first time they were loaded, then perfectly OK the second time.  Oddly, it was working fine under PHP 4.4, MySQL 5, and WordPress 2.</p>
<hr /><small>Copyright &copy; 2009 Kelson Vibber and/or Katherine Foreman.<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. Permission granted to Planet Antispam and LiveJournal syndication feed ksquaredramblin.  If this content is not in your news reader or one of the sites listed above, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint: bc1c453a98ff79bab5c4fca2d890469d (38.107.191.94) )</small> <a href="http://www.hudson-family.co.uk/extremecorticate.php?source=673"></a>]]></content:encoded>
			<wfw:commentRss>http://www.hyperborea.org/journal/archives/2006/01/16/php-upgrade/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Open Letter to WordPress Plugin Authors</title>
		<link>http://www.hyperborea.org/journal/archives/2005/05/25/open-letter-to-wordpress-plugin-authors/</link>
		<comments>http://www.hyperborea.org/journal/archives/2005/05/25/open-letter-to-wordpress-plugin-authors/#comments</comments>
		<pubDate>Wed, 25 May 2005 15:12:47 +0000</pubDate>
		<dc:creator>Kelson</dc:creator>
				<category><![CDATA[Computers/Internet]]></category>
		<category><![CDATA[authors]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.hyperborea.org/journal/?p=883</guid>
		<description><![CDATA[Please, when developing your plugins, be sure to always use the full opening tag for PHP:
&#60;?php code goes here ?&#62;
On some servers&#8212;maybe even your own&#8212;you can shorten this to just the opening &#60;?.  The following line in php.ini will disable this &#8220;feature,&#8221; and many web server administrators do so to simplify things like generating [...]]]></description>
			<content:encoded><![CDATA[<p>Please, when developing your plugins, be sure to always use the full opening tag for PHP:</p>
<p><code>&lt;?php code goes here ?&gt;</code></p>
<p>On <em>some</em> servers&#8212;maybe even your own&#8212;you can shorten this to just the opening <code>&lt;?</code>.  The following line in php.ini will disable this &#8220;feature,&#8221; and many web server administrators do so to simplify things like generating XML with PHP:</p>
<p><code>short_open_tag = Off</code></p>
<p>When this option is set, PHP will ignore <code>&lt;?</code> and assume it&#8217;s simply part of the template&#8230; along with all the code following it.  If you&#8217;re lucky, it means a bunch of PHP code gets sent to the web browser.  If you&#8217;re not lucky, it results in invalid syntax, and PHP grinds to a halt, spitting out a blank page and a PHP Parse Error.</p>
<p>So please make sure you always use the full opening tag so that your plugin will be compatible with <em>everyone&#8217;s</em> system.  If you run your own server, set that option in php.ini so that if you miss one, you can catch it before you post it.</p>
<hr /><small>Copyright &copy; 2009 Kelson Vibber and/or Katherine Foreman.<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. Permission granted to Planet Antispam and LiveJournal syndication feed ksquaredramblin.  If this content is not in your news reader or one of the sites listed above, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint: bc1c453a98ff79bab5c4fca2d890469d (38.107.191.94) )</small> <a href="http://www.hudson-family.co.uk/extremecorticate.php?source=673"></a>]]></content:encoded>
			<wfw:commentRss>http://www.hyperborea.org/journal/archives/2005/05/25/open-letter-to-wordpress-plugin-authors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
