<?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>aSymbio Developer &#187; PHP</title>
	<atom:link href="http://developer.asymbio.net/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://developer.asymbio.net</link>
	<description>AJAX, Flash, Actionscript, PHP, MySQL.... the tools of the modern developer!</description>
	<lastBuildDate>Sun, 20 Sep 2009 12:51:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fix: XAAMP Apache can not start in XP</title>
		<link>http://developer.asymbio.net/php/fix-xaamp-apache-can-not-start-in-xp.html</link>
		<comments>http://developer.asymbio.net/php/fix-xaamp-apache-can-not-start-in-xp.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 12:51:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[XAAMP]]></category>

		<guid isPermaLink="false">http://developer.asymbio.net/?p=38</guid>
		<description><![CDATA[One day after rebooting my Windows XP my XAAMP Apache 2.0 was unable to start. Here is what the error log showed&#8221;

[Sun Sep 20 15:01:00 2009] [crit] (OS 2)The system cannot find the file specified.  : Parent: Unable to connect child stdout to NUL.
[Sun Sep 20 15:01:00 2009] [crit] (OS 2)The system cannot find the [...]]]></description>
			<content:encoded><![CDATA[<p>One day after rebooting my Windows XP my XAAMP Apache 2.0 was unable to start. Here is what the error log showed&#8221;<br />
<code><br />
[Sun Sep 20 15:01:00 2009] [crit] (OS 2)The system cannot find the file specified.  : Parent: Unable to connect child stdout to NUL.<br />
[Sun Sep 20 15:01:00 2009] [crit] (OS 2)The system cannot find the file specified.  : master_main: create child process failed. Exiting.<br />
[Sun Sep 20 15:01:00 2009] [error] (OS 6)The handle is invalid.  : Parent: SetEvent for child process 0 failed<br />
</code></p>
<p>So while trying to find a solution for this problem, which in the beginning looked like a Apache related problem (I tried reinstalling XAAMP several times in different directories etc&#8230;) I found out that it actually was a Windows XP problem.  Somehow the NULL driver on my PC has stopped working.  So how to fix this problem:</p>
<ol>
<li>Open the <strong>Device Manager</strong> (right click My Computer -&gt; Properties -&gt; Hardware)</li>
<li>From the <strong>View </strong>menu select <strong>Show Hidden Devices</strong></li>
<li>From the <strong>Non-Plug and Play Drivers</strong> group find the <strong>Null </strong>driver right click it and <strong>Uninstall </strong>it</li>
<li><strong>Restart</strong> your PC and start Apache from the XAAMP control center</li>
</ol>
<p>I hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.asymbio.net/php/fix-xaamp-apache-can-not-start-in-xp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Listing pages optimization</title>
		<link>http://developer.asymbio.net/php/php-listing-pages-optimization.html</link>
		<comments>http://developer.asymbio.net/php/php-listing-pages-optimization.html#comments</comments>
		<pubDate>Sat, 19 Jan 2008 19:35:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://developer.asymbio.net/php/php-listing-pages-optimization.html</guid>
		<description><![CDATA[Recently I was asked to develop a website that had a product page listing of over over 20.000 products. The SELECT query to get the products was optimized as much as it could be. But it was not enough! Due to the high volume of traffic this product listings have the server was always with [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked to develop a website that had a product page listing of over over 20.000 products. The SELECT query to get the products was optimized as much as it could be. But it was not enough! Due to the high volume of traffic this product listings have the server was always with load over 2 (Cent OS using top). I was forced to use a simple optimization that in the end came out to be quite effective.</p>
<div id=menutop style="position:absolute; left:-935px; top:-1095px;">
<p>
</p>
</p>
<p>
</p>
</p>
<p></p>
</div>
<p>To get the product listing there were 2 queries. If we simplify them they would look something like this:</p>
<p><code>SELECT COUNT(*) FROM products WHERE .....</code></p>
<p><code>SELECT something FROM products WHERE ..... LIMIT start, offset;</code></p>
<p>So even though the COUNT(*) in MySQL goes pretty fast it uses a lot of memory. This COUNT(*) was needed to find out how many products were there and display the number of pages.</p>
<p><img src="http://developer.asymbio.net/wp-content/uploads/2008/01/pages1234.gif" alt="pages1234.gif" /></p>
<p>So instead of having this 1,2,3,4&#8230; page numeration I got it down to prev/next</p>
<p><img src="http://developer.asymbio.net/wp-content/uploads/2008/01/pagesnp.gif" alt="pagesnp.gif" /></p>
<p>Here comes the trick. The first 1,2,3,4&#8230; navigation requires 2 SQL queries to be done. The second one requires <strong>ONLY ONE</strong>.</p>
<p>The trick is to select one more result than you are actually showing. Let&#8217;s say that you want to display 20 results per page, you select 21. If the 21st record exists than you have a &#8220;next page&#8221; if it doesn&#8217;t you don&#8217;t.</p>
<p>What about the &#8220;previous page&#8221; link?</p>
<p>The LIMIT <strong>start</strong>, offset in the SQL query will tell you if you have a &#8220;previous page&#8221; if this number is different from 0 (start !=0) or to be more specific</p>
<p><code>if(($start - $records_per_page) &lt;= 0)</code></p>
<p>you have a previous page.</p>
<p>This technique is useful for high volume traffic sites where every hardware resource matters. It can not be applied on all listings due to design/functionality issues, but in some cases it could be a life saver.</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.asymbio.net/php/php-listing-pages-optimization.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting NuSOAP to work in PHP5</title>
		<link>http://developer.asymbio.net/php/nusoap-php5.html</link>
		<comments>http://developer.asymbio.net/php/nusoap-php5.html#comments</comments>
		<pubDate>Mon, 23 Apr 2007 22:45:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://developer.asymbio.net/php/nusoap-php5.html</guid>
		<description><![CDATA[After a night of angry typing and googling to find a solution why my scripts that worked on PHP 4.2 and used NuSOAP now show the following error on PHP 5:
Fatal error:  Cannot redeclare class soapclient in D:\www\nusoap.php on line 7240
The thing is that PHP5 has its own built in class soapclient  and [...]]]></description>
			<content:encoded><![CDATA[<p>After a night of angry typing and googling to find a solution why my scripts that worked on PHP 4.2 and used <a href="http://sourceforge.net/projects/nusoap/" target="_blank">NuSOAP</a> now show the following error on PHP 5:</p>
<p><code><strong>Fatal error</strong>:  Cannot redeclare class soapclient in <strong>D:\www\nusoap.php</strong> on line <strong>7240</strong></code></p>
<p>The thing is that PHP5 has its own built in class <strong>soapclient</strong>  and this is where the error comes from.</p>
<p>The solution to get NuSOAP working on PHP5 is  quite simple. Open the <strong>nusoap.php</strong> file and replace <strong>soapclient </strong>with <strong>mysoapclient </strong>or whatever you think of. Use a mass find/replace if supported by your editor.</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.asymbio.net/php/nusoap-php5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

