Created
December 3, 2015 20:42
-
-
Save DHager/a63d36dade21150dd86d to your computer and use it in GitHub Desktop.
Tries to cause a core-dump so that you can test your PHP/Apache/OS configuration to make sure they are being saved
This file contains hidden or 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 | |
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); | |
header("Cache-Control: post-check=0, pre-check=0", false); | |
header("Pragma: no-cache"); | |
ob_end_flush(); | |
$pid = getmypid(); | |
$secs = 10; | |
$cmd = "kill -3 $pid"; | |
echo("Pid is $pid<br/>\n"); | |
echo("Sleeping for $secs<br/>\n"); // In case you want to kill it manually | |
flush(); | |
sleep($secs); | |
echo("Attempting self-kill with $cmd<br/>\n"); | |
flush(); | |
// SIGQUIT is number 3, for some reason -SIGQUIT is not accepted | |
system($cmd); | |
sleep(1); | |
echo("Couldn't self-terminate<br/>\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment