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:
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.
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:
Keywords: php, windows-xp, system-shell, webdev, problems, solutions, troubleshooting, iis
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:
- Open Windows Explorer and browse to the c:\windows\system32 or c:\winnt\system32 directory.
- Right-click on cmd.exe, and select Properties....
- Click the Security tab.
- If Internet Guest Account is not already listed, then click Add, then Advanced..., then Find Now.
- Scroll down to and select IUSR_MachineName, where MachineName is the name of your computer.
- Click OK twice to return to the Security tab.
- Select Internet Guest Account and then click the box under Allow for Read & Execute.
- Click OK.
Keywords: php, windows-xp, system-shell, webdev, problems, solutions, troubleshooting, iis
Comments