I can't seem to find a definitive answer for this one.
When invoking a shell command using exec() from PHP, does the memory that shell command uses count towards the memory limit that the PHP script is given?
I realise that if the command generates a lot of output, and that output is captured in the $ouput (second) parameter of exec(), then that returned data could blow the PHP memory limit. However, assuming all output is sent to a file, if the exec() command requires 128M of memory to run, should a PHP script with a limit of 64M of memory be able to run it?
<?php
exec('command_using_128M_memory >/dev/null 2>&1');
I'm assuming PHP5.3+