Skip to main content

PHP WebDev: Resolving an 'Unable to Fork' Warning in Windows

Resolving an unable to fork PHP warning in Windows

I was trying to execute a PHP script which launches a batch file in Windows. Althought I verified that the path to my batch file is in the PATH environmental variable, I always get the following error:

Warning: system() [function.system]: Unable to fork


This problem happens now that I use Microsoft Internet Information Server (IIS) as the web server. It didn't happen when I was using Apache HTTP Server 2.0.

After 15 minutes on Google here's what I found out: PHP's Unable to Fork problem is related to Windows security setting.

By default, the system's "Internet Guest Account"–the IIS's anonymous web client account–is explicitly blocked from executing cmd.exe–the command line shell.


At the risk of system security being compromised, according to the instruction on Somacon.com, we can allow the Internet Guest Account to execute cmd.exe by:

  1. Open Windows Explorer and browse to the c:\windows\system32 or c:\winnt\system32 directory.

  2. Right-click on cmd.exe, and select Properties....

  3. Click the Security tab.

  4. If Internet Guest Account is not already listed, then click Add, then Advanced..., then Find Now.

  5. Scroll down to and select IUSR_MachineName, where MachineName is the name of your computer.

  6. Click OK twice to return to the Security tab.

  7. Select Internet Guest Account and then click the box under Allow for Read & Execute.

  8. Click OK.


Keywords: , , , , , , ,

Comments

Popular posts from this blog

"Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine" Error on Windows 7 (64-bit) + Office 2010 (64-bit) + Visual Studio 2010

If you use (1) Windows 7 (64-bit), and (2) Office 2010 (64-bit), and  (3) Visual Studio 2010 to write an ASP.NET code to connect to Access or Excel database using the Microsoft.ACE.OLEDB.12.0 provider and consistently get the "Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine" error, try installing the 2007 Office System Driver: Data Connectivity Components , which is basically a Microsoft Access Database Engine 2007 Redistributable for Windows (32-bit) from http://www.microsoft.com/download/en/details.aspx?id=23734 Many forums suggested by Google Search suggest installing the Microsoft Access Database Engine 2010 Redistributable for Windows (32-bit, 64-bit) downloadable from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13255 but it wouldn't help because Visual Studio 2010 is a 32-bit application; what you need is a 32-bit Data Connectivity component. The 2010 download will not allow you to install i...

Tips: Mac OS X: Full ANSI Color Support in Terminal.app

I'm trying to switch my Java development platform from Windows XP to Mac OS X Tiger. Wondering how to colorize the Terminal screen, I spent some time googling. From the discussions at the end of this page: macosxhints.com - Add full ANSI color support to Terminal.app Here's a summary of how to enable it: With bash shell as default, simply add export TERM=xterm-color [I prefer this for Linux compatibility] or export TERM=dtterm in the ~/.profile (single-user) or /etc/profile (system-wide) Color terminal is enabled. Use ' ls -G ' (the -G enables color output) to test. Add alias ls='ls -G' in the profile file for convenience. Keywords: mac-os-x , unix , terminal , shell , tips

iTunes: Error 261 while Burning Data CDs/DVDs

Apple Discussions: 261 error while burning MP3 CD. I usually put an aphostrophe (') in the name of playlists and was having error 261 burning CD/DVD data discs since iTunes 5.1. Upgrading to iTunes 6.0 for Windows doesn't help. I was burning a music DVD this morning and had Error 261 again. So I went to Apple iTunes Discussions site and look for a thread on this. Viola! There are many people having the same problem as mine. The thread ends at a point where someone removing ampersands, the '&' symbols, from their playlists and could avoid this error. I tried removing aphostrophes from the name of my playlist because aphostrophe falls into the kind of non-alphabet characters that needs escaping in some programming languages. It works!! Keywords: itunes , windows