Re: where does exec look for the program?
| From: | Rich Peters | Date: | Wed, 11 Oct 2000 19:24:11 +0000 |
| Subject: | Re: where does exec look for the program? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19679@lists.php.net to get a copy of this message | ||
Daniel,
the web server is using php_mod, so its not compiled as cgi
I tried what you suggested, with a slight mod to make it parse:
$cmdline = "\"$fullname\" . \"Micro-Magic\" . \"$SerialNo" ;
$RegKey = exec("/home/umagic/cgi-bin/regkey \"$cmdline\"",
$msgs,$rc) ;
Its still not finding regkey to execute. Its never getting to the command
line.
regards,
Rich Peters
Micro-Magic
----- Original Message -----
From: "Daniel Rezny" <daniel@mail.viapvt.sk>
To: "Rich Peters" <rpeters@micro-magic.com>; "php-list"
<php-general@lists.php.net>
Sent: Wednesday, October 11, 2000 12:12 PM
Subject: Re: [PHP] where does exec look for the program?
> Hello Rich,
>
> Wednesday, October 11, 2000, 8:07:06 PM, you wrote:
>
>
> RP> Hello, this is my first time on this list, so be gentle. I am also new
to
> RP> PHP.
>
> RP> I have compiled a small c program called regkey, which computes a key.
> RP> I have it installed in my cgi-bin of my webserver It is marked as
> RP> executable (755), and it runs correctly from a telnet session.
>
> RP> I am trying to exec it from a php file. the code below always fails
with a
> RP> code of 2, or file not found.
>
> RP> <?php
> RP> // compute new key
> RP> $cmdline = "\"$fullname\" . \"Micro-Magic\" .
> RP> \"$SerialNo" ;
>
> RP> $RegKey = exec("/home/umagic/cgi-bin/regkey $cmdline", $msgs,$rc)
;
> ?>>
>
> RP> I have heard that you can only exec things in the apache path. Is
there a
> RP> way to work around this? the following works:
>
> RP> $RegKey = exec("ls -d", $msgs,$rc) ;
>
> RP> regards,
>
> RP> Rich Peters
>
>
> Do you have php compiled as cgi to apache?
> $cmdline = "\"$fullname\" . \"Micro-Magic\" .
> \"$SerialNo\"";
> $RegKey = exec("/home/umagic/cgi-bin/regkey $cmdline", $msgs,$rc);
>
> try this
> With last quote in the and of line 1
> --
> Best regards,
> Daniel mailto:daniel@mail.viapvt.sk
>
>