@parruc opened this issue on July 7th 2015

We have the same error reported here: #6222 but on the ps that gets running processes:

     static function getRunningProcesses()
        $ids = explode("\n", trim(`ps ex 2>/dev/null | awk '{print $1}' 2>/dev/null`));

        $ids = array_map('intval', $ids);
        $ids = array_filter($ids, function ($id) {
            return $id > 0;

        return $ids;

Running it manually in the bash we get a list of process ids but from php we get

WARNING CoreConsole[2015-07-07 07:49:33] /var/www/piwik/core/CliMulti/Process.php(248):
 Warning - shell_exec(): Unable to execute 'ps ex 2>/dev/null | awk '{print $1}' 2>/dev/null' - 
Piwik 2.13.1 - Please report this message in the Piwik forums: http://forum.piwik.org
 (please do a search first as it might have been reported already)
@mattab commented on July 15th 2015

Hi @parruc

In CLI / ssh, do these command output a lot of text (ie. are they working) - php -r "echo shell_exec('ps ex');" - php -r "echo shell_exec('ps ex 2>/dev/null | awk \'{print $1}\' 2>/dev/null');"

@mnapoli commented on July 20th 2015

Please also try this one:

php -r "echo shell_exec('ps ex | awk \'{print $1}\'');"
@parruc commented on July 27th 2015

Launched from the cli, works as expected and did not happen anymore, so I guess It was a memory problem or something similar... Closing it

This issue was closed on July 27th 2015
Powered by GitHub Issue Mirror