I have seen a lot of ways to determen if a PHP script is already running but I wonder which solution is the best.Currently I'm using this:
<?php $run = basename($_SERVER['PHP_SELF'], '.php') . '.run'; if (!file_exists($run) { touch($run); } else { echo "Already running!"; exit; } // ... (rest of code)?>
But I already have seen a lot examples using pid's & sid's and everything. I'm sure my solution is not the best at all and so I'm asking you all to discuss your solutions with me.