Skip to content

Instantly share code, notes, and snippets.

@makgithub
Created September 7, 2017 12:20
Show Gist options
  • Save makgithub/82a7ab94b742fc7fa241745f4374e5de to your computer and use it in GitHub Desktop.
Save makgithub/82a7ab94b742fc7fa241745f4374e5de to your computer and use it in GitHub Desktop.
PHP popen function
<?php
/*
* This is the child process, it'll be launched
* from the parent process.
*/
/* Do some work */
echo "large process is running";
?>
<?php
echo "\n doning the work in Main file\n";
echo date("h:i:s");echo "\n";
$commandName="/var/www/html/main.php"; //Provide full path of the php file
$handle = popen('php ' . $commandName , 'r');
echo date("h:i:s");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment