<?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>Microbits &#187; php</title>
	<atom:link href="http://microbits.info/index.php/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://microbits.info</link>
	<description>Random thoughts about programming, gaming, and the world.</description>
	<lastBuildDate>Mon, 31 Oct 2011 04:43:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>EAccelerator does not play nice with multiple workers</title>
		<link>http://microbits.info/index.php/2010/06/eaccelerator-does-not-play-nice-with-multiple-workers</link>
		<comments>http://microbits.info/index.php/2010/06/eaccelerator-does-not-play-nice-with-multiple-workers#comments</comments>
		<pubDate>Sun, 20 Jun 2010 21:47:56 +0000</pubDate>
		<dc:creator>recon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://microbits.info/?p=578</guid>
		<description><![CDATA[After a few PHP access violations, I&#8217;m pretty sure EAccelerator does not work properly with multiple IIS worker processes. I should really move to lighttpd or nginx one of these days&#8230;]]></description>
			<content:encoded><![CDATA[<p>After a few PHP access violations, I&#8217;m pretty sure EAccelerator does not work properly with multiple IIS worker processes.</p>
<p>I should really move to lighttpd or nginx one of these days&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://microbits.info/index.php/2010/06/eaccelerator-does-not-play-nice-with-multiple-workers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More on eAccelerator</title>
		<link>http://microbits.info/index.php/2009/12/more-on-eaccelerator</link>
		<comments>http://microbits.info/index.php/2009/12/more-on-eaccelerator#comments</comments>
		<pubDate>Sun, 27 Dec 2009 22:27:04 +0000</pubDate>
		<dc:creator>recon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://microbits.info/?p=429</guid>
		<description><![CDATA[Now that I&#8217;m correctly loading the extension (zend_extension_ts), eAccelerator is running smoothly. I found something interesting in the event log yesterday: PHP Warning: [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.9. Rebuild it for your PHP version (5.2.9-2) or download precompiled binaries. Now that error message makes perfect sense. The reason I [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I&#8217;m correctly loading the extension (zend_extension_ts), eAccelerator is running smoothly.</p>
<p>I found something interesting in the event log yesterday:</p>
<pre class="brush: plain">
PHP Warning:  [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.9. Rebuild it for your PHP version (5.2.9-2) or download precompiled binaries.
</pre>
<p>Now that error message makes perfect sense. The reason I didn&#8217;t see it the first time around is that PHP logged two messages separately at the same time. If I was reading a flat file log, I would&#8217;ve noticed it immediately.</p>
]]></content:encoded>
			<wfw:commentRss>http://microbits.info/index.php/2009/12/more-on-eaccelerator/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thread safety and PHP</title>
		<link>http://microbits.info/index.php/2009/12/thread-safety-and-the-insanity-of-php-on-windows</link>
		<comments>http://microbits.info/index.php/2009/12/thread-safety-and-the-insanity-of-php-on-windows#comments</comments>
		<pubDate>Sun, 27 Dec 2009 04:06:30 +0000</pubDate>
		<dc:creator>recon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://microbits.info/?p=419</guid>
		<description><![CDATA[UPDATED After a few seg-faults, I realized that eAccelerator isn&#8217;t thread safe (I was running it under a thread safe server)&#8230; It is thread safe&#8230; I just wasn&#8217;t loading it in thread safe mode (see the manual for details). Whoops.]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>UPDATED</strong></span></p>
<p>After a few seg-faults, I realized that eAccelerator <span style="text-decoration: line-through;">isn&#8217;t thread safe (I was running it under a thread safe server)&#8230; </span><span style="color: #ff0000;"><strong>It is thread safe</strong></span>&#8230; I just wasn&#8217;t loading it in thread safe mode (<a href="http://eaccelerator.net/wiki/InstallFromSource" target="_blank">see the manual for details</a>). Whoops.</p>
]]></content:encoded>
			<wfw:commentRss>http://microbits.info/index.php/2009/12/thread-safety-and-the-insanity-of-php-on-windows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eAccelerator</title>
		<link>http://microbits.info/index.php/2009/12/eaccelerator</link>
		<comments>http://microbits.info/index.php/2009/12/eaccelerator#comments</comments>
		<pubDate>Sun, 27 Dec 2009 00:59:46 +0000</pubDate>
		<dc:creator>recon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://microbits.info/?p=411</guid>
		<description><![CDATA[After getting somewhat annoyed with the slowness of my blog, and having nothing better to do, I decided to setup eAccelerator. I&#8217;m pretty sure I tried setting it up a long time ago, but for some reason, didn&#8217;t finish. Following the path of logic, I went to the eAccelerator website in search of the appropriate [...]]]></description>
			<content:encoded><![CDATA[<p>After getting somewhat annoyed with the slowness of my blog, and having nothing better to do, I decided to setup eAccelerator. I&#8217;m pretty sure I tried setting it up a long time ago, but for some reason, didn&#8217;t finish.</p>
<p>Following the path of logic, I went to the <a href="http://eaccelerator.net/" target="_blank">eAccelerator website</a> in search of the appropriate files. Their Windows section directed me to <a href="http://www.sitebuddy.com/PHP/Accelerators/eAccelerator_windows_binaries_builds" target="_blank">SiteBuddy</a>, which had a nice collection of binaries for various PHP versions. After determining my PHP version (5.2.9-2), I tried the closest match (5.2.9), and was greeted by the following error in the Windows event log:</p>
<pre class="brush: text">Unable to start eAccelerator module in Unknown on line 0.</pre>
<p>My initial reaction to the error: what the ****&#8230; (<a href="http://microbits.info/?p=429" target="_blank">UPDATE: See this post for more details</a>) After a quick Google search, I found that PHP modules must be built for the EXACT PHP version you plan to use them on.</p>
<p>Since I have just about every Microsoft C++ compiler, I figured compiling a new eAccellerator module for my version of PHP would be simple. I downloaded the archived PHP files I needed (now I understand why they keep archives), switched to the release configuration, and pressed build.<br />
<span id="more-411"></span></p>
<pre class="brush: text">error C2466: cannot allocate an array of constant size 0</pre>
<p>My reaction to this was about the same as the other one. After half an hour, I tracked down and fixed the problem, which was a <a href="http://bugs.php.net/bug.php?id=39130" target="_blank">broken Windows build configuration (which the PHP developers KNEW about, and marked as &#8220;Wont Fix&#8221;)</a>.</p>
<p>The solution was to make the changes suggested by sailormax.</p>
<p>In the end, everything compiled, and you&#8217;re reading my post through eAccelerator. I noticed that blog page loads are 2 &#8211; 3 times faster. <img src='http://microbits.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://microbits.info/index.php/2009/12/eaccelerator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InDefero &#8211; include(&#8220;commonsense.php&#8221;);</title>
		<link>http://microbits.info/index.php/2009/08/indefero-includecommonsense-php</link>
		<comments>http://microbits.info/index.php/2009/08/indefero-includecommonsense-php#comments</comments>
		<pubDate>Sat, 08 Aug 2009 23:09:32 +0000</pubDate>
		<dc:creator>recon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web applications]]></category>

		<guid isPermaLink="false">http://microbits.info/?p=224</guid>
		<description><![CDATA[I spent a really long time (8+ hours) setting up an open source project tracker called InDefero. I was also trying to setup Git at the same time, but that&#8217;s something for another post. InDefero has no install wizard (one is in the works though), so all the configuration is manual. Installing the DB tables [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a really long time (8+ hours) setting up an open source project tracker called <a href="http://www.indefero.net/" target="_blank">InDefero</a>. I was also trying to setup Git at the same time, but that&#8217;s something for another post.</p>
<p>InDefero has no install wizard (one is in the works though), so all the configuration is manual. Installing the DB tables requires you to run a PHP CLI script. Everything was going smoothly until I tried to install the tables. The script exited with no output every time I ran it.</p>
<p>I tried to debug the script with echo statements, and traced to issue to a require statement that was causing execution to stop. After tinkering with several of the scripts, including the script in the require statement (the config file), and still having the install script fail, the thought occurred to me, why am I not getting any debug info from PHP?</p>
<p>Since the php.ini I was using was setup for production, display_errors was off. After turning it on with a CLI switch, I got a debug message. My config file was messed up. After going to the indicated line, I realized what happened.<br />
<span id="more-224"></span><br />
The InDefero config file has a secretKey field that you&#8217;re supposed to put a random string in. I used <a href="http://pwgen-win.sourceforge.net/" target="_blank">PWGen</a> (a neat open source password generator) to generate the random string. The only problem was, I opted to include special characters. In most programming languages, there are special characters that have to be escaped, and PWGen happened to put a few in the string it generated.</p>
<p>After selecting the alpha num character set in PWGen, generating a new string and putting it in the config file, the install script ran successfully.</p>
<p>I was thinking, finally, it&#8217;s working. Then, I browsed to the admin project list, and got a nice exception page. After spending a few hours figuring out that it was a database name escape issue, and not a permissions problem, I <a href="http://projects.ceondo.com/p/indefero/issues/278/" target="_blank">reported and fixed</a> the bug.</p>
<p>When you&#8217;re debugging a problem, remember, read each error message carefully. Read it several times, word for word. Not reading the error properly can cause you to spend a lot of time on something that isn&#8217;t related to the error message.</p>
<p>Unfortunately, the SVN browser in InDefero is way too slow. I&#8217;m going to have to switch to something else <img src='http://microbits.info/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://microbits.info/index.php/2009/08/indefero-includecommonsense-php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Download Monitor bug fixes</title>
		<link>http://microbits.info/index.php/2009/07/download-monitor-bug-fix</link>
		<comments>http://microbits.info/index.php/2009/07/download-monitor-bug-fix#comments</comments>
		<pubDate>Thu, 30 Jul 2009 04:07:46 +0000</pubDate>
		<dc:creator>recon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://microbits.info/?p=38</guid>
		<description><![CDATA[After using Download Monitor (a WP plugin), I noticed there was a little annoying bug in uploader.php, which prevented me from using the post uploader form. To fix, find (in uploader.php): &#60;option value=""&#62;&#60;?php _e('N/A',"wp-download_monitor"); ?&#62;&#60;/option&#62; Replace with: &#60;option value="0"&#62;&#60;?php _e('N/A',"wp-download_monitor"); ?&#62;&#60;/option&#62; Another minor bug is that there was a missing space when using the download [...]]]></description>
			<content:encoded><![CDATA[<p>After using <a href="http://wordpress.org/extend/plugins/download-monitor/" target="_blank">Download Monitor</a> (a WP plugin), I noticed there was a little annoying bug in uploader.php, which prevented me from using the post uploader form.</p>
<p>To fix, find (in uploader.php):</p>
<pre class="brush: php">&lt;option value=""&gt;&lt;?php _e('N/A',"wp-download_monitor"); ?&gt;&lt;/option&gt;</pre>
<p>Replace with:</p>
<pre class="brush: php">&lt;option value="0"&gt;&lt;?php _e('N/A',"wp-download_monitor"); ?&gt;&lt;/option&gt;</pre>
<p>Another minor bug is that there was a missing space when using the download short code (link titles looked like VersionNumHere instead of Version NumHere).</p>
<p>To fix, find (in wp-download_monitor.php):</p>
<pre class="brush: php">$format = '&lt;a class="downloadlink" href="{url}" title="{version,"'.__("Version","wp-download_monitor").'", ""} '.__("downloaded","wp-download_monitor").' {hits} '.__("times","wp-download_monitor").'" &gt;{title} ({hits})&lt;/a&gt;';</pre>
<p>Replace with:</p>
<pre class="brush: php">$format = '&lt;a class="downloadlink" href="{url}" title="{version,"'.__("Version","wp-download_monitor").' ", ""} '.__("downloaded","wp-download_monitor").' {hits} '.__("times","wp-download_monitor").'" &gt;{title} ({hits})&lt;/a&gt;';</pre>
]]></content:encoded>
			<wfw:commentRss>http://microbits.info/index.php/2009/07/download-monitor-bug-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.842 seconds -->

