Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two PHP scripts that I need to start on boot. I have a CentOS powered VPS, and I normally use the following command to start the scripts.

screen php scriptname.php

However, if the server crashes, how can I have the scripts start automatically on boot?


share|improve this question
up vote 2 down vote accepted

Add your command to /etc/rc.d/rc.local

share|improve this answer
And similary thread on… :) – strangeman Jul 13 '11 at 3:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.