RE: [PHP] Running CLI from a web page
| From: | Jay Blanchard | Date: | Mon, 10 Nov 2003 12:57:42 +0000 |
| Subject: | RE: [PHP] Running CLI from a web page | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-169026@lists.php.net to get a copy of this message | ||
[snip]
I have a php cli that creates a file. It works fine when I execute it
from
the Linux command line as "php foo > bar". I'm trying to also execute
this
by clicking a form button on a web page via "system('php foo > bar')".
I
can see that the file bar gets created but it's always empty. I've
tried
executing "system('php foo')" (directly to STDOUT) but get no output.
I've
tried "exec('php foo',$output)" but there's nothing in the array when
it's
done.
Suggestions???
[/snip]
Put something in script foo that will echo out some information
echo "foo is running\n";
and then run it from the command line. If that works then run it from
your form.