Strange problem with the functions exec() / system()...

php.internals

Michael Vergoz

20 years ago
Salut I have a strange problem with the functions exec() / system()... I have a threaded Web server which executes a script PHP executing itself another init.d script (/etc/init.d/apache start). When I stopped the Web server I can not bind() any more the port of this one. In fact I have the feeling that the kernel does not free the socket properly. Did somebody already face this problem? Thanks

Wez Furlong

20 years ago
My hunch is that your sockets are being inherited by the child process(es). You should look at setting the close-on-exec flag on your sockets. --Wez. On 4/12/06, Michael Vergoz <mv-php@binarysec.com> wrote:

Michael Vergoz

20 years ago
Yes thank you i have identify the problem. ----- Original Message ----- From: "Wez Furlong" <kingwez@gmail.com> To: "Michael Vergoz" <mv-php@binarysec.com> Cc: "PHPdev" <internals@lists.php.net> Sent: Monday, April 17, 2006 2:06 PM Subject: Re: [PHP-DEV] Strange problem with the functions exec() / system()... My hunch is that your sockets are being inherited by the child process(es). You should look at setting the close-on-exec flag on your sockets. --Wez. On 4/12/06, Michael Vergoz <mv-php@binarysec.com> wrote: