Re: executing a PHP (shell script) through PHP (module)
| From: | Evan Nemerson | Date: | Mon, 08 Oct 2001 23:01:41 +0000 |
| Subject: | Re: executing a PHP (shell script) through PHP (module) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70395@lists.php.net to get a copy of this message | ||
System just executes the script without returning the output. To get the
output instead if system("script"); use something like echo
script;
On Monday 08 October 2001 12:50 pm, you wrote:
> Hi all
>
> I've compiled PHP in module and in CGI mode.
>
> I want to execute a PHP script (shell script) through a PHP page like that
> ...
>
> page.php
> --------------------------
> <?php
> system("script");
> ?>
> --------------------------
>
>
> script
> --------------------------
> #!/usr/local/bin/php -q
> <?php
> print("test");
> ?>
> --------------------------
>
>
> In my page.php nothing appears ...
> (if I remove the -q option, page.php only shows "Content-type: text/html ")
>
>
>
> If "script" is written in PERL ....
>
> ---------------------------
> #!/usr/bin/perl
>
> print "test";
>
> ---------------------------
>
> .... it works perfectly : page.php shows "test"
> (thus it is not a binpath problem)
>
>
>
> Is there something I miss ?
>
>
> TIA
>
>
> ps : could you forward to fxbois@free.fr