title: Run php script in monit
body: <p>Good day.</p>
  
  <p>Is there any way to run a php "my_script.php" script as action in the fall a demon that keeps alive a node.js server?</p>
  
  <p>The script to execute deletes records from a table of connected persons:</p>
  
  <p>I tried different ways but it does not work me, currently the script that monitors the process is as follows:</p>
  
  <pre><code>#monit script 
  set logfile /var/log/monit.log
  
  check process nodejs with pidfile "/var/run/mi_server.pid"
  start program = "/sbin/start mi_server"
  stop program  = "/sbin/stop mi_server"
  if failed port 8079 protocol HTTP
     then
     exec "/var/www/html/proyect/script_delete_pers.php"
  </code></pre>
  
  <p>Any idea how to properly execute the script?</p>
  
  <p>regards</p>