RE: [PHP] Question about exec() call an CLI php script from Apache CGI/filter module PHP

From: Date: Thu, 28 Jul 2005 19:25:04 +0000
Subject: RE: [PHP] Question about exec() call an CLI php script from Apache CGI/filter module PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-219555@lists.php.net to get a copy of this message
I forgot to mention that calling from shell directly s.php runs correctly. ~~~~~~~~~~~~~~~~~~~~~~~~~ marvin:~/liang.ns2user.info/php> ./s.php This is a PHP-CLI Script!!0123456789 ~~~~~~~~~~~~~~~~~~~~~~~~~ The php configuration of this site is: http://liang.ns2user.info/php/info.php Thank you in advance. Liang
I call red.php through apache http request, and red.php make exec('./s.php') call, then I got bunch of s.php processes, and system locked me out any task due to no more processes available. Why this would happen? marvin:~/liang.ns2user.info/php> less red.php <?php ignore_user_abort(true); header("Location: redirect2.html"); exec('./s.php'); ?> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ marvin:~/liang.ns2user.info/php> less s.php #!/usr/local/bin/php -q <?php echo "This is a PHP-CLI Script!!"; for($i=0;$i<10;$i++) { echo $i; sleep(1); } $fp = fopen("/tmp/foo.txt","a"); fputs($fp,$i); fclose($fp); ?> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ marvin:~> ps -u liang
 PID TTY          TIME CMD
20368 ?        00:00:00 s.php
3184 ?        00:00:00 s.php
27596 ?        00:00:00 s.php
17509 ?        00:00:00 s.php
10471 ?        00:00:00 s.php
20244 ?        00:00:00 s.php
31762 ?        00:00:00 s.php
12067 ?        00:00:00 s.php
14125 ?        00:00:00 s.php
13003 ?        00:00:00 s.php
25257 ?        00:00:00 s.php
22482 ?        00:00:00 s.php
3117 ?        00:00:00 s.php
27203 ?        00:00:00 s.php
28537 ?        00:00:00 s.php
30534 ?        00:00:00 s.php
 873 ?        00:00:00 s.php
8452 ?        00:00:00 s.php
 306 ?        00:00:00 s.php
15703 ?        00:00:00 s.php
24708 ?        00:00:00 s.php
5745 ?        00:00:00 s.php
11949 ?        00:00:00 s.php
  34 ?        00:00:00 s.php
22545 ?        00:00:00 s.php
11775 ?        00:00:00 s.php
12333 ?        00:00:00 s.php
27383 ?        00:00:00 s.php
 612 ?        00:00:00 s.php
6437 ?        00:00:00 s.php
14648 ?        00:00:00 s.php <defunct>
14040 pts/1    00:00:00 tcsh
14027 pts/1    00:00:00 ps
I am really confused, anybody has any idea? Thank you very much. Liang


« previous php.general (#219555) next »