Re: PHP shell commands (exec, passthru and system) won't execute
| From: | Francis Smit | Date: | Thu, 01 Jun 2000 00:05:48 +0000 |
| Subject: | Re: PHP shell commands (exec, passthru and system) won't execute | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-160@lists.php.net to get a copy of this message | ||
Mike Graziano wrote:
> To all,
>
> I posted this question once before on the general PHP list; however, now
> that the list has been segmented into different groups, I thought I'd try
> once again.
>
> I am a PHP newbie and am having trouble getting PHP shell commands (exec,
> passthru and system) to execute. Even something as simple as
>
> <?
> system("dir c:\\");
> ?>
>
> won't execute on a Webserver running NT Server 4.0 and IIS 4.0. The message
> that comes back is
>
> Warning: Unable to fork [dir c:\] in C:\Inetpub\wwwroot\mjg\test1.php on
> line 2
>
> This very same script ran on a Linux Webserver. Permissions have been set
> very liberally so I don't think this is the issue. Other PHP scripts that
> do not contain shell commands do execute.
>
> One suggestion was to try either
>
> system("command /c dir c:\\");
>
> or
>
> system("cmd /c dir c:\\");
>
> Neither of these were successful and resulted in similar error.
>
> Does any one have any ideas?
>
> Thx in advance,
Try the full path and name thing
i.e. my sys has "%SystemRoot%\system32\cmd.exe" in the
link/shortcut in my menu try that though I think the full
thing i.e. system("C:\\winnt\\system32\\cmd.exe dir C:\\")
on my sys.
--
Francis Smit
Knowledge By Design/OzTel
Suite 201, 683 George st
Sydney 2000 NSW
http://www.kbd.com.au
mailto:francis@kbd.com.au
Tel: +61 2 9212 1399
Fax: +61 2 9212 5727
___________________________________
m$: How can we stuff you up today?