Re: exec() in win2k + IIS5, PHP4
| From: | John Smith | Date: | Sat, 29 Jul 2000 10:12:17 +0000 |
| Subject: | Re: exec() in win2k + IIS5, PHP4 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1396@lists.php.net to get a copy of this message | ||
If you are running IIS5 with php4 installed as a module you'll never be able
to get working a command from the shell (i don't know why but i've tested
it is so).
To get an exec() command working you have to uninstall your php as module
and make it work as cgi version.
In this way u can execute every kind of shell command.
John
----- Original Message -----
From: "Mize, Robert" <Robert.Mize@COMPAQ.com>
To: <php-windows@lists.php.net>
Sent: Friday, July 28, 2000 5:35 PM
Subject: [PHP-WIN] exec() in win2k + IIS5, PHP4
> 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.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>