28. September 2006 22:46
General . PHP
Earlier this week, BillS has posted some information on how to run PHP on the upcoming IIS 7. To be honest, it's quite similar to installing it onto IIS 6 but with a few steps less.
But I have a warning to add... PHP is added as an ISAPI extension, which binds to the multi-threaded IIS worker process. Unfortunately, not all PHP extensions are thread-safe... Registering the PHP as a CGI is better, but decreases performance.
How to solve this?
Use FastCGI! This technique can also be used on some Apache installations, but I still prefer IIS to do the job because it can run both PHP and ASP.NET. FastCGI recycles PHP processes and even persistent database connections! (mysql_pconnect etc.)
Here's a quick how to (IIS6)
- Make sure you have at least PHP 4.3.x installed
- Download http://www.caraveo.com/fastcgi/fastcgi-0.6.zip and unpack isapi_fcgi.dll into your PHP installation folder
- Create the following registry key with regedit.exe:
- Add the following registry values (change the path to your config!):
AppPath = c:\websrvapps\php\php.exe
BindPath = php-fcgi
- Add the application mapping extensions for PHP to be sent to the FastCGI DLL:
- Open the Internet Service Manager (MMC), and select the desired Web site or application directory
- Open the item's properties (right click, properties) and click the Home Directory, Virtual Directory or Directory tab
- Click "Configuration" and then App Mappings
- Click add and set the file extension .php. The Executable textbox should be filled with the path to your FastCGI DLL, i.e.: c:\websrvapps\php\fastcgi.dll
- Save all changes and restart IIS
Optionally, you can follow these steps for other extensions if you want PHP to execute on for example .php3 files.
From now on, your scripts should contain the new global $_SERVER['FCGI_SERVER_VERSION'], which is filled with FastCGI's version number.
You can also set some extra tweaks in the registry... This can be done for different file extensions separately. For example, if you also add .php3, you can limit its use in favour of .php files. This does not make much sense, but it could make sense if you also use FastCGI for Perl and/or other CGI processors.
The following registry values can be added into HKEY_LOCAL_MACHINE:\Software\FASTCGI\.php (I put the defaults here):
- MaxPostData REG_DWORD 0
Byte limit for pre-reading the post data
- CustomVars REG_BINARY 0
Delimited by newlines, can be used to specify additional environment names that the web interface should look for in addition to the defaults
- ThreadPoolSize REG_DWORD 10
IIS ONLY, size of the thread pool FastCGI should provide
- BypassAuth REG_DWORD 0
IIS ONLY, if 1 and IIS is configured to use isapi_fcgi.dll as a filter, and IIS is configured to use BASIC authentication, this will force all authentication requests to use the IIS anonymous user. This in effect allows scripts to implement their own authentication mechanisms.
- Impersonate REG_DWORD 1
IIS ONLY, if 1, IIS security tokens will be used to impersonate the IIS authenticated (or anonymous) users. I recommend you not to disable this one...
- StartServers REG_DWORD 2
How many FastCGI processes should be started
- IncrementServers REG_DWORD 2
How many FastCGI processes should be started in addition when there are not sufficient processes available
- MaxServers REG_DWORD 25
Maximum FastCGI processes
- Timeout REG_DWORD 600
How long (seconds) extra processes (number above StartServers) are kept alive before being terminated
For more information on the FastCGI configuration, checkout www.fastcgi.com.
25. September 2006 08:46
Personal . General
I'm back from vacation! I went to Salou
, Spain. Not to party or to find a new girlfriend every evening (I have one for almost 4 years now), but just for the sun and some vacation feeling after a year of work.
The photo on the left was taken on the beach between Salou and Cambrils. Back to work now, be it a little more tanned than a week ago
12. September 2006 08:56
General . C#
Scott Guthrie, one of the Microsoft "Atlas" guys, announced the "Atlas" 1.0 Naming and Roadmap stating that:
- It will be 100% cross-browser and cross-platform.
- It will be a fully supported product: the product has a committed servicing product lifetime of 10 years which provides companies with the ability to depend on it for mission critical applications.
Another nice thing in Scott's post is the following:
11. September 2006 18:26
Personal . General
Sometimes, I take a look at Google maps to check if Belgium is finally mapped and photographed with more detail. When I checked today, I found out some regions near Antwerp and Brussels now are much more detailed. On my house picture, before really blurry, I can see the snapshots were taken during the summer: our new umbrella (is parasol correct English?) is open on the terrace.
Looking for evidence of this update, I found an unofficial article on Tweakers.net stating that also the Netherlands have had a major imagery update.
The article also states that some military bases are totally blurred out. Seems like I work on a military base? (which is not)
Seems like Proxis
is offering a 10% discount when you order 2 computer books before the end of september! And I saw 2 nice PHP books... "Php5 Objects, Patterns, Practice"
and "Php 5 Power Programming"
. Anyone knows if I should give them a try? If you have other great titles on topics like PHP, C# and ASP.NET, please comment this post with title and ISBN number