Neden PHP CLI getmypid in () pid olarak 0 verir?

0 Cevap php

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).

Birisi bunu düzeltmek için nasıl biliyor mu? Ben pencerelerin üzerinde çalışan bir cini yapabilir miyim? Belki düzeltme pcntl_fork ile bölmek olacak?

P.S. Ben bir üs olarak Yii ve en CConsoleCommand sınıfını kullanıyorum.

0 Cevap