If you want a cronjob too you can do it after all the other things above with the following:
If debian: apt-get install sudo
then
crontab -e
*/10 * * * * sudo -u www-data php /var/www/html/TSN-Ranksystem-master/worker.php check >/dev/null 2>&1
That cron checks if the bot is still running, if not he gets restarted