Created
March 26, 2020 06:25
-
-
Save anovsiradj/7aa76a76e058003d449e2ebf0fa77a15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$s = __FILE__; | |
$l = __DIR__.'/tmp.log'; | |
$p = __DIR__.'/tmp.pid'; | |
$z=$c=$r=null; | |
if (in_array('bg',$argv)) { | |
file_put_contents($p,getmypid()); | |
die; | |
} | |
if (file_exists($l)) { | |
$c = fopen($l, 'r'); | |
$z = filesize($l); | |
$r = fread($c,$z); | |
fclose($c); | |
unset($c); | |
} | |
$x = exec("/usr/bin/nohup /usr/bin/php ${s} bg > ${f} 2>&1 &"); | |
var_dump($z,$r,$c,$l,$s,$x); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment