title: Run php script on background in PHP with nohup CLI
body: <p>I,m trying to run one php script in background. But its no working... I can only run directly from the ssh terminal. Using the same cli script.</p>
  
  <p>On the terminal, first i access the path: <code>cd labs.lung.com.br/ztbot/bin/v2/php</code> 
  After that, i run my script in background: <code>nohup php get_tweets.php &gt; /dev/null &amp;</code></p>
  
  <p>And it works! But, when i try to do the same thing with my php script: <code>exec("nohup php get_tweets.php &gt; /dev/null &amp;");</code> doesnt work. Both files are in the same directory.</p>
  
  <p>I list the files in that folder: <code>exec("ls");</code> And they are in the same level...</p>
  
  <p>Until PID its returned, when i run: <code>echo(shell_exec("nohup php get_tweets.php &gt; /dev/null &amp; echo $!"));</code></p>
  
  <p>But for some reason the script doesnt run.</p>