Current time: 11-25-2024, 07:59 PM Hello There, Guest! (LoginRegister)


Post Reply 
Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
Author Message
circut_breaker Offline
Junior Member
*

Posts: 11
Joined: Feb 2010
Reputation: 0
Post: #12
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
Hmm, I think it might be possible.

I got the point but i can't get it to work.

I have already installed php5-cli package what should(?) contain pcntl extension.

So i enable it using php.ini of user website.
Quote:extension=php_pcntl.dll

But when i want run following code.

Code:
<?
function convert_video() {
    function shutdown() {
        posix_kill(posix_getpid(), SIGHUP);
    }

    // Go to background
    $pid = pcntl_fork(); // fork
    if ($pid < 0) return false; // Unable to fork
    else if ($pid) return true;
    else {
         // child, but not detached from the main process yet. Cleanup things
        ob_end_clean(); // Discard the output buffer and close
        fclose(STDIN);  // Close all of the standard
        fclose(STDOUT); // file descriptors as we
        fclose(STDERR); // will be running in background.
        register_shutdown_function('shutdown');
        // Try to become master
        if (posix_setsid() < 0) exit(1);
        // And do the final fork out of apache/fastcgi control
        if (pcntl_fork()) exit(0);

        mail('admin@xxx.xxx', 'start', 'start');
        sleep(600);
        mail('admin@xxx.xxx', 'stop', 'stop');

        // Exit cleanly when the task has been completed.
        exit(0);
    }
}
convert_video();
?>


And of course it says it don't have it Wink

Code:
Fatal error: Call to undefined function pcntl_fork()


Any idea... except recompile php with pcntl - enabled ?
03-06-2010 04:58 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0 - circut_breaker - 03-06-2010 04:58 AM

Forum Jump:


User(s) browsing this thread: 3 Guest(s)