title: Why in PHP CLI getmypid() returns 0 as a pid?
body: <p>I'm developing a long running command line script and of course I want in not to launch itself more than once. So I write a .pid file and on launch check if a process with such PID exists.
  The problem is on Windows it returns 0 as a PID, so I always get a process by that PID running (System Idle has PID 0).</p>
  
  <p>Does someone know how to fix that? Can I make a daemon running on windows? Maybe the fix will be forking with pcntl_fork?</p>
  
  <p>P.S. I'm using Yii and it's CConsoleCommand class as a base.</p>