Problem:
In PHP, need to execute a program in (freebsd terms) /usr/local/bin
in meta-terms:
int i;
i = [execute command](arguments);
There seems to be quite a few execution methods in PHP
(sorry in advance for being thick), and, er, I was
wondering if someone could give me a quick pointer
to appropriate ones I should study to:
1. execute a command and wait till it finishes
2. enable a bunch of arguments to be sent to it
3. receive an integer from the completion of that command
{i.e. if the command is in C++,
which it will be, then it returns from and exit(interger) }.
Maybe, as a bonus,
4. timeout if the command does not return
Its a lot to ask, but from what I see so far in PHP
(and I am becoming a fan) then I reckon it can be done.
Many thanks, tom
In PHP, need to execute a program in (freebsd terms) /usr/local/bin
in meta-terms:
int i;
i = [execute command](arguments);
There seems to be quite a few execution methods in PHP
(sorry in advance for being thick), and, er, I was
wondering if someone could give me a quick pointer
to appropriate ones I should study to:
1. execute a command and wait till it finishes
2. enable a bunch of arguments to be sent to it
3. receive an integer from the completion of that command
{i.e. if the command is in C++,
which it will be, then it returns from and exit(interger) }.
Maybe, as a bonus,
4. timeout if the command does not return
Its a lot to ask, but from what I see so far in PHP
(and I am becoming a fan) then I reckon it can be done.
Many thanks, tom
Comment