<?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>IIS Hacks &#124; Server and System Administration &#187; PHP</title>
	<atom:link href="http://www.iishacks.com/index.php/category/software/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iishacks.com</link>
	<description>System and Network Administration, IIS, Exchange Server, Windows Tips, Opinions</description>
	<lastBuildDate>Thu, 12 Aug 2010 05:08:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Converting MySQL tables from Latin1 to UTF8</title>
		<link>http://www.iishacks.com/2009/11/20/properly-converting-mysql-tables-from-latin1-to-utf8/</link>
		<comments>http://www.iishacks.com/2009/11/20/properly-converting-mysql-tables-from-latin1-to-utf8/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 17:33:13 +0000</pubDate>
		<dc:creator>Chris Stinson</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.iishacks.com/?p=508</guid>
		<description><![CDATA[Many content management systems and forums were originally created using the latin1 character set and the latin1_swedish_ci collation in MySQL. The problem many of these systems are facing today is the growing demand for multi-language content using special characters that cannot be accurately represented in the latin1 character set. This is where utf8 comes in.
The [...]


Related posts:<ol><li><a href='http://www.iishacks.com/2007/06/21/vbulletin-photopost-and-mysql-5/' rel='bookmark' title='Permanent Link: vBulletin / Photopost and MySQL 5'>vBulletin / Photopost and MySQL 5</a></li><li><a href='http://www.iishacks.com/2008/09/13/delete-spam-comments-in-wordpress-via-mysql/' rel='bookmark' title='Permanent Link: Delete Spam Comments in Wordpress via MySQL'>Delete Spam Comments in Wordpress via MySQL</a></li><li><a href='http://www.iishacks.com/2008/01/18/find-duplicate-records-and-the-number-of-duplicates-in-sql-mysql/' rel='bookmark' title='Permanent Link: Find Duplicate Records and the Number of Duplicates in SQL (MySQL)'>Find Duplicate Records and the Number of Duplicates in SQL (MySQL)</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Many content management systems and forums were originally created using the latin1 character set and the latin1_swedish_ci collation in MySQL. The problem many of these systems are facing today is the growing demand for multi-language content using special characters that cannot be accurately represented in the latin1 character set. This is where utf8 comes in.</p>
<p>The problem with simply converting a database from latin1 to utf8 is in the data itself. When you convert a database or table to a different character set or collation, it does not convert the content held within the tables. What happens is users end up with ‘strange’ characters in their data.</p>
<p><img class="alignnone size-full wp-image-510" title="strange_a_e" src="http://www.iishacks.com/wp-content/uploads/2009/11/strange_a_e.jpg" alt="strange_a_e" width="136" height="44" /></p>
<p><img class="alignnone size-full wp-image-509" title="latin1_convert_to_utf8" src="http://www.iishacks.com/wp-content/uploads/2009/11/latin1_convert_to_utf8.jpg" alt="latin1_convert_to_utf8" width="542" height="80" /></p>
<p>You can prevent this by taking steps to protect the data before you convert the database or tables.</p>
<p><strong>An overview of the steps:</strong></p>
<ol>
<li>Backup the database. <strong>No, really, do it.</strong></li>
<li>Alter the string field types to their binary equivalents in all tables. This will protect the data during conversion.<br />
• VARCHAR to VARBINARY<br />
• CHAR to BINARY<br />
• LONGTEXT to LONGBLOB<br />
• MEDIUMTEXT to MEDIUMBLOB<br />
• TEXT to BLOB<br />
• TINYTEXT to TINYBLOB</li>
<li>Convert the database and tables from latin1 to utf8 character set and latin1_swedish_ci to utf8_general_ci collation.</li>
<li>Convert the binary field types back to their original string field types.</li>
<li>Backup the resulting database.</li>
<li>Finished</li>
</ol>
<p>Ex. Generic convert column to BLOB from TEXT</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">ALTER</span> <span class="kw1">TABLE</span> tbl_name <span class="kw1">MODIFY</span> column_name BLOB</div>
</div>
<p>Ex. Generic convert table to new character set</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">ALTER</span> <span class="kw1">TABLE</span> tbl_name CHARACTER <span class="kw1">SET</span> charset_name COLLATE collation_name</div>
</div>
<p>Ex. Generic convert database to new character set utf8</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">ALTER</span> <span class="kw1">DATABASE</span> database_name CHARACTER <span class="kw1">SET</span> utf8;</div>
</div>


<p>Related posts:<ol><li><a href='http://www.iishacks.com/2007/06/21/vbulletin-photopost-and-mysql-5/' rel='bookmark' title='Permanent Link: vBulletin / Photopost and MySQL 5'>vBulletin / Photopost and MySQL 5</a></li><li><a href='http://www.iishacks.com/2008/09/13/delete-spam-comments-in-wordpress-via-mysql/' rel='bookmark' title='Permanent Link: Delete Spam Comments in Wordpress via MySQL'>Delete Spam Comments in Wordpress via MySQL</a></li><li><a href='http://www.iishacks.com/2008/01/18/find-duplicate-records-and-the-number-of-duplicates-in-sql-mysql/' rel='bookmark' title='Permanent Link: Find Duplicate Records and the Number of Duplicates in SQL (MySQL)'>Find Duplicate Records and the Number of Duplicates in SQL (MySQL)</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.iishacks.com/2009/11/20/properly-converting-mysql-tables-from-latin1-to-utf8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Dynamic Replacement</title>
		<link>http://www.iishacks.com/2008/09/12/wordpress-dynamic-replacement/</link>
		<comments>http://www.iishacks.com/2008/09/12/wordpress-dynamic-replacement/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 03:28:09 +0000</pubDate>
		<dc:creator>Chris Stinson</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.iishacks.com/?p=143</guid>
		<description><![CDATA[Wordpress has long had a feature that dynamically replaces standard characters with their more visually appealing (and perhaps more accurate) symbols. In some cases the formatting may not be desirable.
Last year I wrote a few articles on Exchange Server errors. The errors typically follow the form of 0xNumber, ex. 0x8000000F. What wordpress was doing was [...]


Related posts:<ol><li><a href='http://www.iishacks.com/2007/07/06/stop-vbulletn-and-wordpress-spam/' rel='bookmark' title='Permanent Link: Stop vBullet*n and Wordpress Spam?'>Stop vBullet*n and Wordpress Spam?</a></li><li><a href='http://www.iishacks.com/2007/07/06/unable-to-load-dynamic-library-php_mysqldll-mysql-5041/' rel='bookmark' title='Permanent Link: Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)'>Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)</a></li><li><a href='http://www.iishacks.com/2009/11/20/properly-converting-mysql-tables-from-latin1-to-utf8/' rel='bookmark' title='Permanent Link: Converting MySQL tables from Latin1 to UTF8'>Converting MySQL tables from Latin1 to UTF8</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Wordpress has long had a feature that dynamically replaces standard characters with their more visually appealing (and perhaps more accurate) symbols. In some cases the formatting may not be desirable.</p>
<p>Last year I wrote a few articles on Exchange Server errors. The errors typically follow the form of 0xNumber, ex. 0x8000000F. What wordpress was doing was replacing the &#8220;x&#8221; in the error with a &#8220;times&#8221; or multiplication symbol. So 0x0 would show up as 0&#215;0.</p>
<p><img src="http://www.iishacks.com/wp-content/uploads/2008/09/x-before.gif" alt="" title="dynamic replace of x in wordpress" width="125" height="23" class="alignnone size-full wp-image-151" /> Dynamic Replace Active</p>
<p><img src="http://www.iishacks.com/wp-content/uploads/2008/09/x-after.gif" alt="" title="proper x in wordpress by removing dynamic replace" width="125" height="23" class="alignnone size-full wp-image-150" /> Dynamic Replace Inactive</p>
<p>My concern was that search engines DO distinguish between &#8220;x&#8221; and the symbol for multiplication. So when people were searching for 0x8004011D my posts did not show up, but when searching for 0&#215;8004011D or 8004011D they did. If you do a google search with the &#8220;times&#8221; symbol instead of an &#8220;x&#8221; for exchange errors, you will find many posts otherwise hidden from the world.</p>
<p>The last string of the regular expression below represents a case for when there is a character followed by an x and by another character without spaces. The x will be replaced with the special character for &#8220;times&#8221; or &# 215 ;</p>
<p>The characters in the image below are the symbols for replacement. Generally the quotes are not misleading to search engines.</p>
<p><img src="http://www.iishacks.com/wp-content/uploads/2008/09/list.gif" alt="" title="dynamic replacement characters and symbols in wordpress" width="140" height="118" class="alignnone size-full wp-image-157" /></p>
<p>The following dynamic string variable is found in the \wp-includes\formatting.php file. If you wish to remove all dynamic characters, simply delete both lines and your wordpress posts will render correctly.</p>
<div class="codesnip-container" >
<pre>$dynamic_characters = array
('/\'(\d\d(?:&amp;#8217;|\')?s)/', '/(\s|\A|")\'/',
'/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/',
'/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');

 $dynamic_replacements = array
('&amp;#8217;$1','$1&amp;#8216;', '$1&amp;#8243;',
'$1&amp;#8242;', '$1&amp;#8217;$2', '$1&amp;#8220;$2',
'&amp;#8221;$1', '&amp;#8217;$1', '$1&amp;#215;$2');</pre>
</div>
<p>If you only want to remove the &#8220;x&#8221; replacement symbol ( &#215; ) use the following lines in formatting.php in place of the originals.</p>
<div class="codesnip-container" >$dynamic_characters = array(&#8217;/\&#8217;(\d\d(?:&amp;#8217;|\&#8217;)?s)/&#8217;, &#8216;/(\s|\A|&#8221;)\&#8217;/',&#8217;/(\d+)&#8221;/&#8217;, &#8216;/(\d+)\&#8217;/', &#8216;/(\S)\&#8217;([^\'\s])/&#8217;, &#8216;/(\s|\A)&#8221;(?!\s)/&#8217;,'/&#8221;(\s|\S|\Z)/&#8217;, &#8216;/\&#8217;([\s.]|\Z)/&#8217;);</p>
<p> $dynamic_replacements = array(&#8217;&amp;#8217;$1&#8242;,&#8217;$1&amp;#8216;&#8217;, &#8216;$1&amp;#8243;&#8217;, &#8216;$1&amp;#8242;&#8217;, &#8216;$1&amp;#8217;$2&#8242;, &#8216;$1&amp;#8220;$2&#8242;, &#8216;&amp;#8221;$1&#8242;, &#8216;&amp;#8217;$1&#8242;);</p></div>


<p>Related posts:<ol><li><a href='http://www.iishacks.com/2007/07/06/stop-vbulletn-and-wordpress-spam/' rel='bookmark' title='Permanent Link: Stop vBullet*n and Wordpress Spam?'>Stop vBullet*n and Wordpress Spam?</a></li><li><a href='http://www.iishacks.com/2007/07/06/unable-to-load-dynamic-library-php_mysqldll-mysql-5041/' rel='bookmark' title='Permanent Link: Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)'>Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)</a></li><li><a href='http://www.iishacks.com/2009/11/20/properly-converting-mysql-tables-from-latin1-to-utf8/' rel='bookmark' title='Permanent Link: Converting MySQL tables from Latin1 to UTF8'>Converting MySQL tables from Latin1 to UTF8</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.iishacks.com/2008/09/12/wordpress-dynamic-replacement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to install PHP ISAPI on Windows 2008 IIS7 x64</title>
		<link>http://www.iishacks.com/2008/07/03/how-to-install-php-isapi-on-windows-2008-iis7-x64/</link>
		<comments>http://www.iishacks.com/2008/07/03/how-to-install-php-isapi-on-windows-2008-iis7-x64/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 20:43:27 +0000</pubDate>
		<dc:creator>Chris Stinson</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Internet Information Server]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iishacks.com/?p=81</guid>
		<description><![CDATA[With the release of Windows Server 2008 and IIS 7, Microsoft has included PHP5 FASTCGI support. ISAPI is still faster in my opinion, and if used correctly, very stable. PHP uses a 32-bit DLL so it will not work with an x64 system. There are several ports of PHP to x64, but all have proved [...]


Related posts:<ol><li><a href='http://www.iishacks.com/2007/07/06/php-52x-isapi-stability-on-windows-iis-60/' rel='bookmark' title='Permanent Link: PHP 5.2.x ISAPI stability on Windows IIS 6.0'>PHP 5.2.x ISAPI stability on Windows IIS 6.0</a></li><li><a href='http://www.iishacks.com/2007/07/15/enabling-internet-on-fresh-windows-server-2008-install/' rel='bookmark' title='Permanent Link: Enabling Internet on fresh Windows Server 2008 install'>Enabling Internet on fresh Windows Server 2008 install</a></li><li><a href='http://www.iishacks.com/2007/11/07/slimming-down-windows-xp-pro-sp2-install/' rel='bookmark' title='Permanent Link: Slimming down Windows XP Pro SP2 Install'>Slimming down Windows XP Pro SP2 Install</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>With the release of Windows Server 2008 and IIS 7, Microsoft has included PHP5 FASTCGI support. ISAPI is still faster in my opinion, and if used correctly, very stable. PHP uses a 32-bit DLL so it will not work with an x64 system. There are several ports of PHP to x64, but all have proved to be unstable. Below I will outline the steps to install PHP 32-bit on Windows 2008 x64 (and have it stable).</p>
<ol>
<li>Install the PHP4 or PHP5 package (32-bit) in C:\PHP or wherever you like. Only use the Windows installer from php.net if you do not need any extensions. I would recommend downloading the <a href="http://windows.php.net/download/">PHP zip package</a>. </li>
<li><strong>Update April 2010</strong>: The VC6 x86 Thread Safe package is ideal for ISAPI. If you are going to use FastCGI, download the VC6 x86 Non Thread Safe package.</li>
<li>Open the Internet Information Services (IIS) Manager. </li>
<li>Double-click &#8220;Handler Mappings&#8221; from the main IIS screen.</li>
<li>Click on &#8220;Add Script Map.&#8221;</li>
<li>Set up the handler mapping for c:\PHP\php5isapi.dll with extension *.php and check to allow the ISAPI extension and execution of scripts.</li>
<li>Double-click &#8220;ISAPI &amp; CGI Restrictions&#8221; on the main IIS screen. Right-click on PHP and select &#8220;Edit Feature Settings&#8221; and check &#8220;Allow unspecified ISAPI modules.&#8221; </li>
<li>Right-click on the Default Application Pool (or the one you want to use if more than one) and select &#8220;Advanced Settings.&#8221;</li>
<li>Change the &#8220;Enable 32-bit Applications&#8221; to True. Click OK. This spawns the App Pool in 32-bit mode, so if you have other modules that need to be run in 64-bit mode, best to separate the website into two App Pools: one 32-bit and one 64-bit.</li>
<li>Restart the server.</li>
</ol>


<p>Related posts:<ol><li><a href='http://www.iishacks.com/2007/07/06/php-52x-isapi-stability-on-windows-iis-60/' rel='bookmark' title='Permanent Link: PHP 5.2.x ISAPI stability on Windows IIS 6.0'>PHP 5.2.x ISAPI stability on Windows IIS 6.0</a></li><li><a href='http://www.iishacks.com/2007/07/15/enabling-internet-on-fresh-windows-server-2008-install/' rel='bookmark' title='Permanent Link: Enabling Internet on fresh Windows Server 2008 install'>Enabling Internet on fresh Windows Server 2008 install</a></li><li><a href='http://www.iishacks.com/2007/11/07/slimming-down-windows-xp-pro-sp2-install/' rel='bookmark' title='Permanent Link: Slimming down Windows XP Pro SP2 Install'>Slimming down Windows XP Pro SP2 Install</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.iishacks.com/2008/07/03/how-to-install-php-isapi-on-windows-2008-iis7-x64/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Wordpress &amp; PHP on Windows Server IIS 6</title>
		<link>http://www.iishacks.com/2007/07/10/wordpress-php-on-windows-server-iis-6/</link>
		<comments>http://www.iishacks.com/2007/07/10/wordpress-php-on-windows-server-iis-6/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 22:38:36 +0000</pubDate>
		<dc:creator>Chris Stinson</dc:creator>
				<category><![CDATA[Internet Information Server]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.iishacks.com/index.php/2007/07/10/wordpress-php-on-windows-server-iis-6/</guid>
		<description><![CDATA[This is a quick tip to those who are having trouble installing or using Wordpress on Windows Server with PHP.
Make sure in the PHP.ini file that the following is set:
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
If this is ON, Wordpress will not allow you to login. It [...]


Related posts:<ol><li><a href='http://www.iishacks.com/2007/05/18/wordpress-21x-22-breaks-php-444/' rel='bookmark' title='Permanent Link: WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4'>WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4</a></li><li><a href='http://www.iishacks.com/2008/07/03/how-to-install-php-isapi-on-windows-2008-iis7-x64/' rel='bookmark' title='Permanent Link: How to install PHP ISAPI on Windows 2008 IIS7 x64'>How to install PHP ISAPI on Windows 2008 IIS7 x64</a></li><li><a href='http://www.iishacks.com/2008/09/12/wordpress-dynamic-replacement/' rel='bookmark' title='Permanent Link: Wordpress Dynamic Replacement'>Wordpress Dynamic Replacement</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This is a quick tip to those who are having trouble installing or using Wordpress on Windows Server with PHP.</p>
<p>Make sure in the PHP.ini file that the following is set:</p>
<div class="codesnip-container" >; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.<br />
magic_quotes_runtime = Off</div>
<p>If this is ON, Wordpress will not allow you to login. It will spit out the following error:</p>
<p>&#8220;You do not have sufficient permissions to access this page.&#8221;</p>
<p>You CAN have magic_quotes ON though, which is a different setting. The above setting is for data being pulled from a MySQL database for example.</p>
<p>Also make sure the following is set:</p>
<div class="codesnip-container" >; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP&#8217;s<br />
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok<br />
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting<br />
; this to 1 will cause PHP CGI to fix it&#8217;s paths to conform to the spec. A setting<br />
; of zero causes PHP to behave as before. Default is zero. You should fix your scripts<br />
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.<br />
cgi.fix_pathinfo=1</div>


<p>Related posts:<ol><li><a href='http://www.iishacks.com/2007/05/18/wordpress-21x-22-breaks-php-444/' rel='bookmark' title='Permanent Link: WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4'>WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4</a></li><li><a href='http://www.iishacks.com/2008/07/03/how-to-install-php-isapi-on-windows-2008-iis7-x64/' rel='bookmark' title='Permanent Link: How to install PHP ISAPI on Windows 2008 IIS7 x64'>How to install PHP ISAPI on Windows 2008 IIS7 x64</a></li><li><a href='http://www.iishacks.com/2008/09/12/wordpress-dynamic-replacement/' rel='bookmark' title='Permanent Link: Wordpress Dynamic Replacement'>Wordpress Dynamic Replacement</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.iishacks.com/2007/07/10/wordpress-php-on-windows-server-iis-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP 5.2.x ISAPI stability on Windows IIS 6.0</title>
		<link>http://www.iishacks.com/2007/07/06/php-52x-isapi-stability-on-windows-iis-60/</link>
		<comments>http://www.iishacks.com/2007/07/06/php-52x-isapi-stability-on-windows-iis-60/#comments</comments>
		<pubDate>Sat, 07 Jul 2007 05:26:31 +0000</pubDate>
		<dc:creator>Chris Stinson</dc:creator>
				<category><![CDATA[Internet Information Server]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.iishacks.com/index.php/2007/07/06/php-52x-isapi-stability-on-windows-iis-60/</guid>
		<description><![CDATA[Having dealt with multiple IIS servers with all kinds of PHP configurations, I&#8217;ll let you in on a little secret. PHP 4.4.4 or 4.4.x ISAPI is by far the most stable in any situation. PHP 5.2.x has terrible memory management. If you have a piece of bad code that eats up memory, PHP will not [...]


Related posts:<ol><li><a href='http://www.iishacks.com/2008/07/03/how-to-install-php-isapi-on-windows-2008-iis7-x64/' rel='bookmark' title='Permanent Link: How to install PHP ISAPI on Windows 2008 IIS7 x64'>How to install PHP ISAPI on Windows 2008 IIS7 x64</a></li><li><a href='http://www.iishacks.com/2007/07/06/unable-to-load-dynamic-library-php_mysqldll-mysql-5041/' rel='bookmark' title='Permanent Link: Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)'>Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)</a></li><li><a href='http://www.iishacks.com/2007/05/18/wordpress-21x-22-breaks-php-444/' rel='bookmark' title='Permanent Link: WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4'>WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Having dealt with multiple IIS servers with all kinds of PHP configurations, I&#8217;ll let you in on a little secret. PHP 4.4.4 or 4.4.x ISAPI is by far the most stable in any situation. PHP 5.2.x has terrible memory management. If you have a piece of bad code that eats up memory, PHP will not put a stop to it like it should. Here&#8217;s an error I received:</p>
<div class="codesnip-container" >The description for Event ID ( 2 ) in Source ( PHP-5.2.2 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: php[3556], PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2061628868 bytes) in Unknown on line 0.</div>
<p>And of course no matter how much memory I allocate, it eats it all up. It&#8217;s just a matter of time. Then comes this error:</p>
<div class="codesnip-container" >Faulting application w3wp.exe, version 6.0.3790.3959, faulting module php5ts.dll, version 5.2.2.2, fault address 0x#.</div>
<p>The obvious solution is to write better code that doesn&#8217;t leak memory. However, this isn&#8217;t always possible, especially if you are hosting websites run by other people. Many shared hosting accounts on IIS 6.0 experience total PHP shutdown due to one site&#8217;s bad code. I have thoroughly tested every 5.2.x line of PHP and they all suffer from this problem. If you want to or need to use PHP 5.2.x, use CGI or Fast-CGI (there&#8217;s a beta from IIS.net) as you will not experience any of these memory issues. However Fast-CGI still isn&#8217;t as quick as ISAPI, and in terms of the IIS.net beta, suffers from max uploads of ~1 MB.</p>
<p><strong>Summary for maximum stability/speed combo:</strong></p>
<p>PHP 4.4.x -&gt; use ISAPI</p>
<p>PHP 5.2.x -&gt; CGI (in PHP package) or Fast-CGI (from IIS.net)</p>
<p>Don&#8217;t use any other line of PHP since they are no longer supported and have multiple security issues.</p>


<p>Related posts:<ol><li><a href='http://www.iishacks.com/2008/07/03/how-to-install-php-isapi-on-windows-2008-iis7-x64/' rel='bookmark' title='Permanent Link: How to install PHP ISAPI on Windows 2008 IIS7 x64'>How to install PHP ISAPI on Windows 2008 IIS7 x64</a></li><li><a href='http://www.iishacks.com/2007/07/06/unable-to-load-dynamic-library-php_mysqldll-mysql-5041/' rel='bookmark' title='Permanent Link: Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)'>Unable to load dynamic library php_mysql.dll (MySQL 5.0.41)</a></li><li><a href='http://www.iishacks.com/2007/05/18/wordpress-21x-22-breaks-php-444/' rel='bookmark' title='Permanent Link: WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4'>WordPress 2.1.x &#8211; 2.2 Breaks PHP 4.4.4</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.iishacks.com/2007/07/06/php-52x-isapi-stability-on-windows-iis-60/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
