Could you explain 'running'. PHP scripts only run when a user makes a request, so its not like a windows program that runs all the time.
If you mean disabling, I would create a secure (pass protected) page which lets you disable / enable the script.
Protected page will update a mysql table.
When the ' running' script is prompted it will check for that value in the mysql table, if set to false don't run the code. If set to true, run the code.
If you need help coding, let me know in a PM