Re: PHP 4.0 Bug #7607: system()ed commands do not exit if the user interrupts transfer
| From: | chrisv at b0rked dot dhs dot org | Date: | Fri, 03 Nov 2000 13:20:17 +0000 |
| Subject: | Re: PHP 4.0 Bug #7607: system()ed commands do not exit if the user interrupts transfer | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-36949@lists.php.net to get a copy of this message | ||
> On 3 Nov 2000 doktor1@earthlink.net wrote:
>
> > From: doktor1@earthlink.net
> > Operating system: SunOS 5.8 Generic sun4u sparc SUNW,Ultra-2
> > PHP version: 4.0.3
> > PHP Bug Type: POSIX related
> > Bug description: system()ed commands do not exit if the user interrupts transfer
> >
> > If I system("/path/to/ping somehost") and then hit Stop or close the browser or
> > go to a different page, the ping process will still be in the process table, and show as being owned
> > (PPID) by httpd. I don't know whether this is an issue with php or with Apache.
> >
>
> system() uses popen() in its underlying implementation. Apparently PHP
> doesn't keep track of what it keeps open and kill them afterward. Try
> using ping -c to limit the number of ping tests or use sockets to do it
> low level within PHP itself.
Unfortunately, the latter can't be done from within PHP, unless PHP is
running with root priveliges. In order to send ICMP packets, one must open
a raw socket, which is usually a priveliged operation..
Chris
>
> --
> Ignacio Vazquez-Abrams <ignacio@openservices.net>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>