Block8/PHPCI — pull request #15 by MarkMaldaba (2013-05-15 15:06:45+00:00)
Title: Fix for running PHP under CGI on Windows machines.

Fix for running PHP under CGI on Windows machines. In this situation, the environement variables defining the system temp path are not necessarily available to PHP, so sys_get_temp_dir() falls back to using the system path (e.g. C:\WINDOWS), which is normally unwritable. This means that temp-file creation fails.

I've added code to detect this situation, and if it occurs we point it to %SystemRoot%\TEMP instead, which usually is present and writable. May not fix 100% of cases, but should fix the vast majority of situations where this may occur.