Can anyone tell me why exec()
function is so slow and time unpredictable on different machines in PHP?
Basically I have some executable file and want to execute it through PHP:
$command = '/usr/pathToComman/myCommand -someParameters';
exec($command);
The thing is that it executes much longer (by much I mean 3-4 sometimes like 25 times longer) then the same command from the shell.
In additional to this the command is executed longer from the PHP on my server, which is stronger (more RAM and more GHz).
So there are two questions:
- why?
- what should I do with this?
P.S. I need this execute, because I can not do the same thing with PHP
P.S.2 Answering @prodigitalson question: It solves the differential equation, but basically no matter what it does, the speed is just much slower. I remember doing some image processing this way and the speed was also much slower.