Windows/php pclose and popen issue
Here is my code: <?php require_once 'dbconnect.php'; function execInBackground($cmd) { if (substr(php_uname(), 0, 7) == "Windows"){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } } if(isset($_GET['date'])){ //CHECK LOCK $checkLock = "Select IS_FREE_LOCK('overnight') as `lock`;"; $result = mysql_query($checkLock) or die(mysql_error()); while($information = mysql_fetch_array($result)){ if($information['lock'] == 0){ die('Overnight is already running, please try again later.'); } } execInBackground("php overnightQueries.php {$_GET['date']}"); //echo "<pre>".print
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.