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
Code:
Fatal error: Call to undefined function pcntl_fork()
Any idea... except recompile php with pcntl - enabled ?