Alt komutuyla gibi komutu php

0 Cevap php

Ben aşağıdaki 2 dosya var ve linux (debian) onları infaz ediyorum.

Dosya1.php

<?php
exec("php -f file2.php > /dev/null 2>&1 &");
sleep(100);

File2.php

<?php
exec("sleep 30 > /dev/null 2>&1 &");
exec("sleep 30 > /dev/null 2>&1 &");
sleep(100);

Şu anda ilk anında dosya1.php başlar ve file2.php kadar patlar ve bir yol uyku komutları başlar. Ilk uyku devam bitirmek için beklemez.

The problem is that the file2.php and sleep commands are not subcommands of file1.php and I can't simply kill it to kill all subcommands. My htop looks like this: http://dl.getdropbox.com/u/5910/Jing/2011-01-13_1611.png

Ben kolayca hepsini öldürmek böylece komutlar dosya1.php bir alt komutları olması için bir yol arıyorum :)

Ben ne var:

'- php -f file2.php
'-sleep 30
'-sleep 30
'- php -f file1.php

temelde ben bu istiyorum:

'- php -f file1.php
  '- php -f file2.php
    '-sleep 30
    '-sleep 30

0 Cevap