Jump to content


php exec(), system(), passthru(), shell_exec() and posix_kill hangs

  • Please log in to reply
1 reply to this topic

#1 krups

  • Members
  • PipPip
  • Member
  • 11 posts

Posted 23 August 2006 - 03:39 PM

I am new to php and have a problem with the following php commads.

exec(), system(), passthru(), shell_exec(). These commands when executed always left a  defunct process.  Then when I reconfigured php with --enable-sigchild option it was better as now it does not leave a defunct process always..... but mosttimes we still get defunct process.

I wrote code to kill defunct process. The code executes correctly. The defunct process also gets killed but later the page is not displayed.  Looks like php hangs.

exec("/bin/kill -9 $ppid";);
system("/bin/kill -9 $ppid /dev/null/ 2>&1 &");
passthru(kill -9 $ppid &);
shell_exec(bin/kill -9 $ppid &);

Also tried
posix_kill($ppid, 1);

where $ppid is parent process id.

Is there any conifuration options that I should use or any php.ini parameters that I should change. Please help me with this query. We are using PHP with apache.

The configure option is as mentioned below.
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mm=/usr/local' '--enable-sigchild' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-fastcgi' '--enable-pcntl' '--enable-posix'

#2 krups

  • Members
  • PipPip
  • Member
  • 11 posts

Posted 24 August 2006 - 02:29 PM

Got no replies for my query. Please can someone suggest if I am missing any configuration parameters or any php.ini parameters to solve this problem.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users