exec() in win2k + IIS5, PHP4

From: Date: Fri, 28 Jul 2000 15:35:35 +0000
Subject: exec() in win2k + IIS5, PHP4
Groups: php.windows 
Request: Send a blank email to php-windows+get-1380@lists.php.net to get a copy of this message
I am trying to execute an external program from php. I would like to add online ping/tracert functions to my intranet, but I am running into problems. Here is what I tried: $cmd="ping.exe"; if(is_executable("$cmd")) { // checking to make sure the file is there - it is! exec($cmd); } this returns the following error: Warning: Unable to fork [ping.exe] in C:\Inetpub\wwwroot\Rob's Site\ping\ping.php3 If I change $cmd to "C:\WINNT\system32\cmd.exe, it gives a similar error (unable to fork). I have tried changing from exec() to shell_exec() and that returns the following error: Warning: Unable to execute 'C:\WINNT\system32\cmd.exe' in C:\Inetpub\wwwroot\Rob's Site\ping\ping.php3 on line 61 PHP has encountered an Access Violation at 77F8AA57 I have tried system(), popen(), and fopen(). All had the same results as above. I have also changed the permissions to give full rights to IUSR in those directories. I have also allowed read-write-execute in IIS Home Directorgy. I don't know what else to try. Any suggestions would be greatly appreciated!! thanks, rob.

« previous php.windows (#1380) next »