The PHP script (your check.php) should be terminated automatically after it finishes running at background.
You probably can try using exit() or die() at the end of the PHP script (your check.php) to make sure the script does jump out .

You can also use the following command to get the $pid. For example, 23456. The "echo $!" part sends the process id.