title: how to run php script as daemon
body: <p>I've this PHP application whose startup is really complicated. I'm inspired from how nodejs works (the application is live and serves clients without load and unload like PHP).</p>
  
  <p>For each request, apache loads the script, instantiate classes and objects (I've so many of them hence startup is resource intensive) and executes it, then unloads it (what a waste), and repeats the same process for the next request.</p>
  
  <p>In Nodejs the script is loaded into memory for the entire session, and code is executed from start to end for each request, there's no loading of script for each request and no unloading at the end of the request. </p>
  
  <p>Is it possible to accomplish the same using linux daemon. I'll be deploying it on AWS Elasticbeanstalk. </p>
  
  <p>Example PHP code</p>
  
  <pre><code>&lt;?php 
  echo "Hello " . $_SERVER["REMOTE_ADDR"];
  //followed by a series of instantiation of several classes and objects at startup
  //would like to have them instantiated only once, keep in memory and then executed
  //based on the URL onwards from there
  //just like how nodejs works 
  ?&gt;
  </code></pre>