Hi,
To enable auto restart of any service/daemons, u can use watchdog like programs.
Ex: Monit (open source)
https://mmonit.com/monit/
By installing this, you can set monitor to services like php, apache, mysql and can trigger to auto restart when any of them stopped