<?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>JimmyLi.net &#187; PHP</title>
	<atom:link href="http://jimmyli.net/category/web/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://jimmyli.net</link>
	<description></description>
	<lastBuildDate>Thu, 04 Aug 2011 21:40:10 +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>New: IIS Tutorial Series</title>
		<link>http://jimmyli.net/2010/08/new-iis-tutorial-series/</link>
		<comments>http://jimmyli.net/2010/08/new-iis-tutorial-series/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 08:03:34 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=127</guid>
		<description><![CDATA[Despite my lack of updates, I&#8217;ve noticed based on search query logs of visitors arriving on this website, a lot of them are regarding installing PHP 5.3 on IIS. Due to the fact that you can no longer use ISAPI with PHP 5.3, I&#8217;ve had the same frustrating experience as others when I was trying [...]]]></description>
			<content:encoded><![CDATA[<p>Despite my lack of updates, I&#8217;ve noticed based on search query logs of visitors arriving on this website, a lot of them are regarding installing PHP 5.3 on IIS. Due to the fact that you can no longer use ISAPI with PHP 5.3, I&#8217;ve had the same frustrating experience as others when I was trying to upgrade from PHP 5.2 to 5.3. I did a lot of research on it, and resources were few, so I decided to write about it once I&#8217;ve successfully was able to upgrade.</p>
<p>Due to the demand of IIS usage there, and resources are few and scatter, I&#8217;ve decided to start an <a href="http://jimmyli.net/iis-tutorial-series/">IIS Tutorial Series</a>, beginning with <a href="http://jimmyli.net/2010/02/installing-fastcgi-and-php-for-iis-6-0/">Part 1: Installing FastCGI and PHP for IIS 6.0</a>. I hope this is able to help a lot of those who are using IIS, especially with PHP. Over time, I will be adding more tutorials. My experience as a web developer mainly began with using Apache, but eventually having to use IIS at my workplace, I&#8217;ve found that a lot of the convenience features with Apache were not available (or easily available) in IIS, so I want to be able to create more tutorials on being able to use such features on IIS.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2010/08/new-iis-tutorial-series/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS Tutorial Series (Part 2): Talking to SQL Server with PHP on IIS</title>
		<link>http://jimmyli.net/2010/08/talking-to-sql-server-with-php-on-iis/</link>
		<comments>http://jimmyli.net/2010/08/talking-to-sql-server-with-php-on-iis/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 09:09:01 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[IIS Tutorial Series]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[mssql]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=114</guid>
		<description><![CDATA[Microsoft now has an official SQL Server Driver to use with PHP on IIS. This is a huge and step forward for PHP/SQL Server developers since beginning with PHP 5.3, the usually packaged MSSQL extension has been deprecated.]]></description>
			<content:encoded><![CDATA[<p>Note: This article is Part 2 of the <a href="/iis-tutorial-series/">IIS Tutorial Series</a>.</p>
<p>Starting with a little history, before PHP 5.3, the options of getting PHP to talk to a Microsoft SQL Database Server was either using a generic database connector, such as ODBC, or PHP&#8217;s included MSSQL connector extension. The MSSQL extension was nice compared to ODBC as you didn&#8217;t have to set up a separate object (the ODBC connection object) to talk to the SQL Server. The MSSQL extension is very similar to PHP&#8217;s popular MySQL Extension as there are functions solely for that database type. Disappointingly, beginning from PHP 5.3, that MSSQL has been deprecated and no longer included with the PHP package, as it was stated to be unstable and unofficially supported (as well as maintenance stopped a long time ago). Initially, people started re-compiling PHP 5.3 on their own with the old MSSQL to get the functionality back, but like for the most of us, re-compiling PHP is not something we would want to step into.</p>
<p>Fortunately, Microsoft stepped up their game and finally started to support more open-source projects such as PHP, and created an official driver to talk to their SQL Server with PHP. In this tutorial, I will go over how to install the SQL Server Driver, and connect to an SQL Server with PHP. This tutorial is applicable for SQL Server 2000 or later, using PHP versions 5.2.4 or later.</p>
<p>Note: You&#8217;ll need to have PHP installed on the IIS Server. If not, read <a href="http://jimmyli.net/2010/02/installing-fastcgi-and-php-for-iis-6-0/">Part 1</a> of the tutorial series on how to do so.</p>
<p>First, visit Microsoft&#8217;s page to download the <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05" target="_blank">SQL Server Driver for PHP</a>. As of this writing, the driver is currently version 2.0. If your SQL Server is installed remotely (not on the same server as the IIS server), you&#8217;ll need to download the Microsoft SQL Server 2008 Native Client at Microsoft&#8217;s <a href="http://www.microsoft.com/downloads/details.aspx?familyid=B33D2C78-1059-4CE2-B80D-2343C099BCB4" target="_blank">SQL Server 2008 Feature Pack</a> site. If the SQL Server is on the same server, then you&#8217;ll already have the necessary Native Client library installed, and you can skip the following step. There are a lot of packages on that page. To quickly locate the right one, scroll down until you find a section &#8220;Microsoft SQL Server 2008 Native Client&#8221;, or you can use your web browser&#8217;s page search functionality to jump to it immediately. Download MSI package appropriate for your server.</p>
<p>If you had to download the SQL Server Native Client, run that executable to install it first. Then, execute the downloaded file for the SQL Server Driver. This will just do a self-extract to a folder. Save the extracted folder anywhere you want. In the folder will be a set of DLLs. Choose the DLL that is appropriate for the PHP package you are using. For more information on which DLL to use, look at the readme that&#8217;s also included in the folder. Copy that DLL and paste it into the &#8220;ext&#8221; directory of your PHP folder (e.g. C:\php\ext\). This adds the extension for PHP to use, and contains the SQL Server API functions you use in your code. This extension talks to the Native Client, which is the interface to the SQL Server.</p>
<p>Next, open up the php.ini in your PHP installation folder, and enable that extension. There should be a section with many lines of:<br />
<em>extension=xxxxxxxxx.dll</em></p>
<p>Add a new line that is specific for the DLL you are using. e.g. <em>extension=php_sqlsrv_53_nts_vc9.dll</em></p>
<p>Restart the IIS Server for all the settings to take effect. To check that the extensions is working, create a PHP script on your website with <a href="http://php.net/phpinfo" target="_blank">phpinfo</a> and the section for the &#8220;sqlsrv&#8221; extension should be in there somewhere.</p>
<p>That should be it for the installation. In the folder for the SQL Server driver should also be a file named <em>SQLSRV20_Help.chm</em>, which is a help file that includes the API documentation of the driver. There is an <a href="http://msdn.microsoft.com/en-us/library/ee229551%28v=SQL.10%29.aspx" target="_blank">online version</a> of the documentation as well.</p>
<p>For example, to connect to a SQL Server database with PHP, you can use something similar to the following code:</p>
<pre class="brush: plain; title: ; notranslate">$connectionInfo = array('UID'=&gt;'Username', 'PWD'=&gt;'password', 'Database'=&gt;'Northwind');
$conn = sqlsrv_connect('MY-DBSERVER', $connectionInfo);
if ($conn === false) die( print_r( sqlsrv_errors() ) );
</pre>
<p>Note: This code applies to authenticating as a SQL Server user, and not a Windows Authentication user. I have not gotten successful connection as a Windows user. If anyone knows how, please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2010/08/talking-to-sql-server-with-php-on-iis/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>IIS Tutorial Series (Part 1): Installing FastCGI and PHP for IIS 6.0</title>
		<link>http://jimmyli.net/2010/02/installing-fastcgi-and-php-for-iis-6-0/</link>
		<comments>http://jimmyli.net/2010/02/installing-fastcgi-and-php-for-iis-6-0/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 06:40:00 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[IIS Tutorial Series]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=63</guid>
		<description><![CDATA[Beginning from PHP 5.3, PHP can only be installed on IIS via a CGI Handler, and no longer through ISAPI. In this tutorial, we'll step through the details of how to set up FastCGI and PHP on IIS.]]></description>
			<content:encoded><![CDATA[<p>Note: This article is Part 1 of the <a href="/iis-tutorial-series/">IIS Tutorial Series</a>.</p>
<p>Despite IIS 7.5 being the current stable IIS release, it is only available for servers running Windows Server 2008. However for the many of us who are still running Windows Server 2003 or Windows XP, IIS 6.0 is our only option. And many of us are still limited to that option.</p>
<p>In this tutorial I will be doing a walkthrough on installing FastCGI and PHP. For those who are a bit new to PHP on IIS, here&#8217;s a general view of what happens when a PHP page is call through the client&#8217;s web browser:<br />
When the client requests a PHP resource (.php), IIS responds by calling FastCGI. FastCGI is the interface to CGI Programs (in this case, PHP), so the web server can focus on web page requests. FastCGI is then responsible for calling the PHP executable to execute the PHP script, and return its response back to IIS. IIS then returns that response back to the client.</p>
<p><span style="text-decoration: underline;"><strong>Installing FastCGI</strong></span><br />
With the stable release of PHP 5.3 out for a while now, the only way to install PHP 5.3 on IIS is through a CGI Handler. PHP 5.2 and earlier allowed us to run PHP using ISAPI, but that option has been deprecated. For those of us intending to move forward, we would have to use CGI from now on.  We&#8217;ll go over installing the <a href="http://en.wikipedia.org/wiki/FastCGI" target="_blank">FastCGI</a> handler on IIS 6.0.</p>
<p>You can download FastCGI for IIS 6.0 <a href="http://www.iis.net/download/FastCGI" target="_blank">here</a> (version 1.5 as of this time).</p>
<p>Run the executable on the web server to install FastCGI. You may have to restart your machine for the installation to complete. When that&#8217;s done, open up IIS Manager and view the list of Web Service Extensions on the server tree. There should be a &#8220;FastCGI Handler&#8221; extension in the list. Make sure its status is set to <em>Allowed</em>. And that&#8217;s it. FastCGI is installed!</p>
<p style="text-align: center;"><a href="http://jimmyli.net/wp/wp-content/uploads/2010/02/web_service_extensions.png" target="_blank"><img class="aligncenter size-medium wp-image-69" title="Web Service Extensions" src="http://jimmyli.net/wp/wp-content/uploads/2010/02/web_service_extensions-300x170.png" alt="" width="300" height="170" /></a></p>
<p><span style="text-decoration: underline;"><strong>Installing PHP</strong></span><br />
Download the latest version of PHP for Windows <a href="http://windows.php.net/download/" target="_blank">here</a>.<br />
We&#8217;ll be doing the manual method of installation, so download the ZIP version and which is <em>Non Thread Safe</em>. It&#8217;s completely up to you whether you want to use the PHP 5.2 series or the PHP 5.3 series. Some applications may work on PHP 5.2 but not 5.3. Either one, the installation process is the same.</p>
<p>Unzip the content to somewhere on your server. I prefer the base of the C drive: C:\php\<br />
Rename the &#8220;php.ini-recommended&#8221; (or &#8220;php.ini-production&#8221; or &#8220;php.ini-development&#8221;, depending on the version of PHP) file to the name &#8220;php.ini&#8221; and make any adjustments to that configuration file. (I won&#8217;t go over that in this tutorial.) You can do this at a later time if you wish. Just like that, PHP is technically &#8220;installed&#8221; on your server.</p>
<p><span style="text-decoration: underline;"><strong>Making PHP work</strong></span><br />
Now, it&#8217;s time to make IIS understand what to do with requests that have the .php extension. When IIS hear a .php file called, we want it to let FastCGI know, so FastCGI can call PHP. To do so, we&#8217;ll have to set up the extension mapping for .php. Open up IIS Manager again and navigate to &#8220;Web Sites&#8221;. Right-click on it and select &#8220;Properties&#8221;. Select the &#8220;Home Directory&#8221; tab, and within it, select &#8220;Configuration&#8230;&#8221; A new window pops up with a listing of Application Extensions.</p>
<p style="text-align: center;"><a href="http://jimmyli.net/wp/wp-content/uploads/2010/02/application_extensions.png" target="_blank"><img class="aligncenter size-medium wp-image-76" title="Application Extensions" src="http://jimmyli.net/wp/wp-content/uploads/2010/02/application_extensions-271x300.png" alt="" width="271" height="300" /></a></p>
<p>Look for the .php extension and &#8220;Edit&#8230;&#8221; it. If it doesn&#8217;t exist, &#8220;Add&#8230;&#8221; the extension. A new windows pops up. For Executable, look for the FastCGI library. For most default installs, it should be under: C:\WINDOWS\system32\inetsrv\fcgiext.dll<br />
For Verbs, limit it to: GET,POST,HEAD<br />
Save all options.</p>
<p style="text-align: center;"><a href="http://jimmyli.net/wp/wp-content/uploads/2010/02/application_extension_mapping.png" target="_blank"><img class="aligncenter size-medium wp-image-77" title="Application Extension Mapping" src="http://jimmyli.net/wp/wp-content/uploads/2010/02/application_extension_mapping-300x169.png" alt="" width="300" height="169" /></a></p>
<p>IIS can request the FastCGI Executable when a .php resource is requested. Now, it&#8217;s time for FastCGI to talk to PHP by modifying FastCGI&#8217;s configuration file. For default installs, the config file should be located at: C:\WINDOWS\system32\inetsrv\fcgiext.ini<br />
Open it in a text editor and add the following at the bottom:</p>
<pre class="brush: plain; title: ; notranslate">[Types]
php=PHP

[PHP]
ExePath=c:\php\php-cgi.exe</pre>
<p>The <em>Types</em> is the extensions it&#8217;s listening to and the corresponding configuration it will use. So here a &#8220;php&#8221; extention will use the [PHP] configuration. The [PHP] configuration has the path to PHP&#8217;s CGI executable. This is how FastCGI knows where to find PHP. Modify the path to where PHP is located on your server.<br />
There are more options you can add, but this should get you going.</p>
<p><span style="text-decoration: underline;"><strong>Testing the Installation</strong></span><br />
Test that the installation went successfully. Restart IIS and create a website hosting a PHP file and output <a href="http://php.net/manual/en/function.phpinfo.php" target="_blank">phpinfo()</a>. If everything went well, you should see the PHP Info page with hints of FastCGI being used in there.</p>
<p style="text-align: center;"><a href="http://jimmyli.net/wp/wp-content/uploads/2010/02/phpinfo.png" target="_blank"><img class="aligncenter size-medium wp-image-78" title="PHP Info" src="http://jimmyli.net/wp/wp-content/uploads/2010/02/phpinfo-300x165.png" alt="" width="300" height="165" /></a></p>
<p><strong>Note:</strong> When I was doing this, I&#8217;ve also experienced a FastCGI error during this last step stating that &#8220;Access is denied&#8221;. I&#8217;m not sure if this is common, but I was able to fix the issue by adjusting the security permissions on the PHP installation folder. I make sure that the users: <em>Administrators</em>, <em>NETWORK SERVICE</em> and <em>SYSTEM</em> are listed. If not, add them, restart IIS, and try to load the PHP page again.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2010/02/installing-fastcgi-and-php-for-iis-6-0/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Finally a working SQL Server Driver for PHP 5.3</title>
		<link>http://jimmyli.net/2009/09/finally-a-working-sql-server-driver-for-php-5-3/</link>
		<comments>http://jimmyli.net/2009/09/finally-a-working-sql-server-driver-for-php-5-3/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 21:17:25 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[ms sql]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[PHP 5.3]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=52</guid>
		<description><![CDATA[Update: I’ve started an IIS Tutorial Series on Talking to SQL Server with PHP on IIS which contains more details of this installation. It&#8217;s been a while since I&#8217;ve touched on the issue of having PHP 5.3 talk to a MS SQL Server on IIS (without using ODBC or other connection methods).  Last time I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Update:</strong> I’ve started an IIS Tutorial Series on <a href="../../2010/08/talking-to-sql-server-with-php-on-iis/">Talking to SQL Server with PHP on IIS</a> which contains more details of this installation.</em></p>
<p>It&#8217;s been a while since I&#8217;ve touched on the issue of having PHP 5.3 talk to a MS SQL Server on IIS (without using ODBC or other connection methods).  <a href="/2009/08/no-sql-server-library-for-php-5-3-just-yet/">Last time</a> I&#8217;ve mentioned that Microsoft has an official SQL Server Driver (v1.0) for PHP to talk to a SQL Server only to find that it doesn&#8217;t work for PHP pre-v5.3, which, we didn&#8217;t really need anyway because PHP already came with a MS SQL Library driver (which was removed from 5.3) that <a href="/2009/03/php-unable-to-connect-to-mssql/">somewhat works</a>.</p>
<p>However, after starting to play around with PHP 5.3 with SQL Server again I&#8217;ve noticed that Microsoft finally release <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9&amp;displaylang=en" target="_blank">v1.1 of the SQL Server Driver</a>, one that was stated to work with PHP 5.3 on IIS. Lo and behold, I was finally able to get it to work.  Even better, the package also came with an offline documentation on installing the driver and the whole API Reference.  Very nice.  For those who are interested, here is the documentation online, the lo-bandwidth version (no MS Frames):<br />
<a href="http://msdn.microsoft.com/en-us/library/cc296172%28SQL.90,loband%29.aspx" target="_blank">SQL Server Driver v1.1 for PHP</a></p>
<p>Note that if your SQL Server is on another server from the PHP server, you&#8217;ll also need to install the SQL Native Client data access library on the PHP server.  (If it is on the same server, the installation of SQL Server already installs this package.)  It is highly recommended to use the latest version that works with SQL Server 2008.  It took me a while to find it (the 2005 version link is rampantly posted everyhere), but you can find it officially here:<br />
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&amp;displaylang=en" target="_blank">Microsoft SQL Server 2008 Feature Pack, August 2008</a></p>
<p>Near the bottom of the page you&#8217;ll find &#8220;Microsoft SQL Server 2008 Native Client&#8221;.  Get the one that&#8217;s appropriate for your machine.  Despite it saying 2008, it should be backwards compatible with earlier versions of SQL Server.  I&#8217;ve tried it as far as SQL Server 2000 (on IIS 6.0) and was able to connect and query successfully (I haven&#8217;t tested for limitations and such, if any.)</p>
<p>And there you have it.  The official method to talk to a MS SQL Server on IIS with PHP 5.3, straight from Microsoft themselves.</p>
<p><span style="text-decoration: underline;">Updated: October 09, 2009</span><br />
The version of the SQL Driver 1.1 that was released in August was a preview release version.  Microsoft officially released the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9&amp;displaylang=en" target="_blank">final version</a> of SQL Server Driver 1.1 on October 6th.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2009/09/finally-a-working-sql-server-driver-for-php-5-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing PHP 5.3 on Microsoft IIS</title>
		<link>http://jimmyli.net/2009/07/installing-php-53-on-microsoft-iis/</link>
		<comments>http://jimmyli.net/2009/07/installing-php-53-on-microsoft-iis/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 20:19:57 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MS IIS]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[PHP 5.3]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=43</guid>
		<description><![CDATA[Update: This article is considered outdated. I&#8217;ve started an IIS Tutorial Series on how to install PHP and FastCGI on IIS 6.0. With the release of PHP 5.3.0 introducing a lot of new features and bug fixes, it also comes in with a lot of changes for Microsoft IIS users.  The biggest one of them [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Update:</strong> This article is considered outdated. I&#8217;ve started an IIS Tutorial Series on <a href="http://jimmyli.net/2010/02/installing-fastcgi-and-php-for-iis-6-0/">how to install PHP and FastCGI on IIS 6.0</a>.</em></p>
<p>With the release of <a href="http://www.php.net/archive/2009.php#id2009-06-30-1">PHP 5.3.0</a> introducing a lot of new features and bug fixes, it also comes in with a lot of changes for Microsoft IIS users.  The biggest one of them is the way that PHP is now installed on IIS.  The PHP 5.3 package now no longer provides an ISAPI DLL file (which I&#8217;ve been using).  The only way to do it is through CGI, in which you should (have to?) use the FastCGI module.  Depending on which version of IIS you have, the setup will be different.  (I have IIS 6.0 on a Windows 2003 server).  Microsoft seems to have gotten more close with Zend recently and provided better support on IIS that they even have a dedicated <a href="http://php.iis.net/">website</a> for installing PHP on IIS and providing community support.  Everything you need to know for installing PHP on IIS is on that website.  PHP also now have a <a href="http://windows.php.net/">website</a> dedicated to supporting PHP on Windows, regardless of whether you&#8217;re using IIS or Apache on Windows.</p>
<p>One of the big drawbacks I&#8217;ve found was that PHP decided to remove the MS SQL Server connection driver in the PHP 5.3 package.  Just adding back in the DLLs from the old PHP packages back in the PHP directory did not work for me.  Not only did they make it harder for IIS users to install PHP, they had to make it harder for those to connect to MS SQL Server.  Upon doing some online searches, the driver used in PHP was very old (which explains <a href="http://jimmyli.net/2009/03/php-unable-to-connect-to-mssql/">my post</a> on trying to get it to work properly on previous versions of PHP).  Microsoft now has it&#8217;s <a href="http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx" target="_blank">own version</a> of MS SQL Server driver (2005 and above) for PHP.  I have yet to install it, but it would have to be done on a development environment to redo any code using PHP&#8217;s old connection library.  I&#8217;ve also yet to find any documentation on it so I&#8217;m not sure of the details of the driver.</p>
<p><span style="text-decoration: underline;">Update: September 24, 2009</span><br />
Maybeme compiled a php_mssql.dll that works in the VC9 version of PHP 5.3. Note that the ntwdblib.dll files is still necessary. I haven&#8217;t gotten it to work personally, but it seems others have, so I&#8217;m sharing it for others who wants to try.</p>
<p>Download here: <a href="http://jimmyli.net/wp/wp-content/uploads/2009/09/php_mssql.dll">php_mssql.dll</a> (right-click &gt; Save Link As&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2009/07/installing-php-53-on-microsoft-iis/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>PHP Unable to Connect to MSSQL</title>
		<link>http://jimmyli.net/2009/03/php-unable-to-connect-to-mssql/</link>
		<comments>http://jimmyli.net/2009/03/php-unable-to-connect-to-mssql/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 07:15:59 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[ntwdblib]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=28</guid>
		<description><![CDATA[Update: This article is considered outdated, and is only valid for PHP versions before 5.3. I’ve started an IIS Tutorial Series on Talking to SQL Server with PHP on IIS, which is valid for any versions of PHP 5.2.4 and later. I have been pulling my hair trying for many hours to connect to a [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Update:</strong> This article is considered outdated, and is only valid for PHP versions before 5.3. I’ve started an IIS Tutorial Series on <a href="http://jimmyli.net/2010/08/talking-to-sql-server-with-php-on-iis/">Talking to SQL Server with PHP on IIS</a>, which is valid for any versions of PHP 5.2.4 and later.</em></p>
<p>I have been pulling my hair trying for many hours to connect to a MSSQL server remotely with PHP.  I was able to connect using ODBC but I wanted a more elegant and native solution.  Trying to connect using PHP&#8217;s MSSQL database library constantly gave me the error:</p>
<pre class="brush: sql; title: ; notranslate">Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 172.xxx.xxx.xxx</pre>
<p>I&#8217;ve tried using the computer name and several other solutions.  Upon doing a lot of research and reading the user notes on the PHP website, and trying out several solutions before finding out a working solution.  I&#8217;ve found that the file ntwdblib.dll packaged with PHP5 (currently 5.2.9-1) is an old version (2000.2.8.0).  Most people suggested replacing it with the later version, 2000.80.194.0.</p>
<p>Click here to download this version of the file: <a href="http://jimmyli.net/wp/wp-content/uploads/2009/03/ntwdblib.zip">ntwdblib.dll</a></p>
<p>I&#8217;ve replaced the file and restarted my IIS webserver and the connection was successful!  I hope this helps for those searching for the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2009/03/php-unable-to-connect-to-mssql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Kohana PHP Framework</title>
		<link>http://jimmyli.net/2009/02/kohana-php-framework/</link>
		<comments>http://jimmyli.net/2009/02/kohana-php-framework/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 07:40:00 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=19</guid>
		<description><![CDATA[I was just reading this blog entry and it reminds me of why using a framework gives the developer so much more flexibility and better off long term, especially for business information systems where business rules change will be made.  Although comparing using a framework as opposed to an out-of-the-box solution is fairly subjective, I [...]]]></description>
			<content:encoded><![CDATA[<p>I was just reading <a href="http://sunlightlabs.com/blog/2009/02/23/content-management-systems-just-dont-work/" target="_blank">this blog entry</a> and it reminds me of why using a framework gives the developer so much more flexibility and better off long term, especially for business information systems where business rules change will be made.  Although comparing using a framework as opposed to an out-of-the-box solution is fairly subjective, I do believe that using a CMS does have its advantage when budget is tight.  However, as a full-time web developer for a company, like myself, using a framework is definitely the way to go.</p>
<p>One framework I&#8217;ve began using recently is the <a title="Kohana" href="http://kohanaphp.com" target="_blank">Kohana</a> PHP 5 Framework.  It&#8217;s a very lightweight framework using the Model-View-Controller (MVC) pattern.  While working with the framework, I&#8217;ve found several things that I really liked over several CMS software such as <a title="Joomla!" href="http://www.joomla.org" target="_blank">Joomla!</a> and <a title="Drupal" href="http://drupal.org" target="_blank">Drupal</a> could not provide (or not that I&#8217;ve noticed, at least).  I really like Kohana&#8217;s simple ability to allow all your scripts to sit under the public root, and be the core of several applications.</p>
<p>Security-wise, I like how simply it is to keep everything under the public root.  The only thing that sits on the public root is in index.php file and any client files (images, CSS, Javascript, etc.)  If the PHP parser fails and the PHP code is exposed, only the index.php is exposed to the public, and it doesn&#8217;t contain anything critical except relative paths to your main application directory, which is inaccessable publically.  Kohana has a core &#8220;system&#8221; directory, and one more or &#8220;application&#8221; directories for each of your web application.  With this type of filesystem, they&#8217;ve implemented the so-called &#8220;cascading filesystem.&#8221;  If there is anything not set in your application directory (e.g. configurations, error pages), Kohana automatically aquires those lower in the filesystem chain, with the &#8220;system&#8221; directory being at the very bottom.</p>
<p>Kohana provides all the abstraction libraries for common use functions, like database access, session management, caching, etc.  Additional modules also such as the Auth module for user authentication makes it simple to create and manage secure passwords and sessions.  Even without a URL rewrite module on your web server, building SEO-link friendly apps should not be an issue.</p>
<p>PHP itself is a very lax scripting language that lets developers do whatever they want, which can have major disadvantages when trying to create organized apps.  Having a framework like Kohana definitely helps keep many things organized.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2009/02/kohana-php-framework/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free PHP Libraries for Creating Professional Reports</title>
		<link>http://jimmyli.net/2009/02/free-php-libraries/</link>
		<comments>http://jimmyli.net/2009/02/free-php-libraries/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 07:27:12 +0000</pubDate>
		<dc:creator>Jimmy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[reports]]></category>

		<guid isPermaLink="false">http://jimmyli.net/?p=12</guid>
		<description><![CDATA[When working on a couple of e-commerce web projects at work, I&#8217;ve found that being able to generate a report dynamically definitely wows a client.  Over time, I was able to find and try out a several PHP libraries from creating reports such as MS Excel files, PDFs and fancy charts.  Here I&#8217;ve compiled a [...]]]></description>
			<content:encoded><![CDATA[<p>When working on a couple of e-commerce web projects at work, I&#8217;ve found that being able to generate a report dynamically definitely wows a client.  Over time, I was able to find and try out a several PHP libraries from creating reports such as MS Excel files, PDFs and fancy charts.  Here I&#8217;ve compiled a list of some of the most reliable, and best of all, free, libraries I&#8217;ve found for PHP.</p>
<p><strong><span style="text-decoration: underline;">Create MS Excel Files</span></strong></p>
<p style="padding-left: 30px;"><strong><a title="PEAR's Spreadsheet_Excel_Writer" href="http://pear.php.net/package/Spreadsheet_Excel_Writer" target="_blank">PEAR&#8217;s Spreadsheet_Excel_Writer</a></strong>: This library has been pretty much untouched, and maybe discontinued, since the end of 2006, and although there have been projects forked from Spreadsheet_Excel_Writer, I&#8217;ve still found this original to be the most reliable.  It does pretty much everything you&#8217;ll probably need it for.  I haven&#8217;t tried any real advanced Excel features, but for most things like using formulas, type and style formatting, etc., it&#8217;s enough.  It is a part of the PEAR framework, so you&#8217;ll need to have that install.  The only issue is that there are some issues with outputting Unicode strings.  There are patches that people have posted around the Internet that fixes it and lets you set a UTF-8 encoding properly.  I&#8217;ve used it and it works, but I do not remember the original source of the patch.</p>
<p><strong><span style="text-decoration: underline;">Create PDFs</span></strong></p>
<p style="padding-left: 30px;"><strong><a title="TCPDF" href="http://www.tcpdf.org" target="_blank">TCPDF</a></strong>: This is probably the best free PDF generation library I&#8217;ve found on the Internet.  I&#8217;ve came upon it by accident while playing around with <a title="Joomla!" href="http://www.joomla.org" target="_blank">Joomla!</a> CMS coding, and I was wow-ed by the number of features that this library supports.  I&#8217;ve found that several other popular CMS also use it for their PDF generation purposes.  One of the most interesting feature is the ability to create PDFs from HTML markup.  Although I haven&#8217;t personally tested how good the HTML to PDF rendering is, it does support inline CSS.  It also has ability to create some charts and support for CMYK colors, which might be useful for those in the printing industry.  Unicode text is fully supported also, but will increase output file size because of the large embedded font data.  The great thing is that this library is constantly updated.</p>
<p style="padding-left: 30px;"><strong><a title="FPDF" href="http://fpdf.org" target="_blank">FPDF</a></strong>: The FPDF library is a fairly simple library and not as extensive as TCPDF, but it has enough features to create a nice PDF document.</p>
<p style="padding-left: 30px;"><strong><a title="FPDI" href="http://www.setasign.de/products/pdf-php-solutions/fpdi/" target="_blank">FPDI</a></strong>: Technically not a PDF generation library, it&#8217;s main use it to be able to import an existing PDF as a template for you to work with.  The library supports both TCPDF and FPDF.  Very useful if want to create a variable-data template where text can be dynamically added on top of a PDF template on demand.  I&#8217;m sure with enough work you can create your own web-to-print system with these tools, but there are better tools for that (but not free), such as <a title="PDFLib" href="http://www.pdflib.com" target="_blank">PDFLib</a></p>
<p><span style="text-decoration: underline;"><strong>Create Charts</strong></span></p>
<p style="padding-left: 30px;"><strong><a title="FusionCharts Free" href="http://www.fusioncharts.com/free/" target="_blank">FusionCharts Free</a></strong>: A free charting software with tons of possibilities in the types of graphs you can create.  The charts are Flash, but you don&#8217;t need to know Flash, and use any common programming language (not limited to PHP).  The documentation is very extensive and you can be on your way to generating fancy charts with animation in no time.</p>
<p style="padding-left: 30px;"><strong><a title="PHP/SWF Charts" href="http://www.maani.us/charts/" target="_blank">PHP/SWF Charts</a></strong>: Another Flash charting software with a lot of graph types.  However, there is a paid license for it and accesses additional features and removes one of the most irritating feature of the free chart: when you click on a chart it goes to the PHP/SWF Charts website.  (There are workarounds to preventing that though.)</p>
<p>With these sets of libraries you should be able to generate some pretty slick and professional reports on your commerce website without spending a dime on software!</p>
<p>Now if I can only find a free library that can create MS Word documents&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://jimmyli.net/2009/02/free-php-libraries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

