PHP Warning: exec() unable to fork

前端 未结 5 801
盖世英雄少女心
盖世英雄少女心 2020-12-01 21:46

So here is a little background info on my setup. Running Centos with apache and php 5.2.17. I have a website that lists products from many different retailers websites. I

5条回答
  •  不思量自难忘°
    2020-12-01 22:12

    Process limit

    "Is there a process limit I should look into"

    It's suspected somebody (system admin?) set limitation of max user process. Could you try this?

    $ ulimit -a
    ....
    ....
    max user processes              (-u) 16384
    ....
    

    Run preceding command in PHP. Something like :

    echo system("ulimit -a");
    

    I searched whether php.ini or httpd.conf has this limit, but I couldn't find it.

    Error Handling

    "even a better way to handle these processes as to get around the error all together?"

    The third parameter of exec() returns exit code of $cmd. 0 for success, non zero for error code. Refer to http://php.net/function.exec .

    exec($cmd, &$output, &$ret_val);
    
    if ($ret_val != 0)
    {
        // do stuff here
    }
    else
    {
        echo "success\n";
    }
    

提交回复
热议问题