In Windows, when trying to execute a system call from a PHP script, you receive a warning like "Warning: system() [function.system]: Unable to fork". A related warning message is "Warning: shell_exec() [function.shell-exec]: Unable to execute"
<?php // print output of shell command executed with backtick operator print htmlentities(`dir`); ?>
The most likely cause is insufficient permissions to execute system calls in the web server environment.
You need to give the Internet Guest Account (a.k.a. IUSR_MachineName or simply IUSR) read and execute permission to the command shell program,
cmd.exe. Typically, permission to this file is explicitly denied as a security measure.
cmd.exe, and select Properties....
It is a very bad idea to allow unvalidated input to any system calls. Remember to use escapeshellcmd for any commands that will contain user input.
You will have to give IUSR appropriate permissions to any other files and folders that the PHP script will access.
Read the Program Execution Functions reference materials in the PHP manual for more information.
Windows XP, 2000, 2003, PHP, IIS 5.1, fork, system, exec, passthru, shell_exec, backtick operator