I would recommend you to deploy
monit what is a nice utility to manage and monitor processes, files and much more. You can monitor a process and its CPU usage with such simple configuration then:
check process your_php_script
start program = "/home/user/bin/your_php_script
stop program = "/usr/bin/pkill your_php_script
if cpu usage > 80% for 5 cycles then restart
Briefly, it will check for a running process "
your_php_script". If it's not running it will start it and if it uses more than 80% of CPU for more than 5 cycles it will restart the process (cycle/polling interval is configured in monit daemon configuration file in