Re: exec in CLI vs. mod_php

From: Date: Fri, 30 May 2003 21:00:57 +0000
Subject: Re: exec in CLI vs. mod_php
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-2098@lists.php.net to get a copy of this message
At 18:18 30/05/2003, Wez Furlong wrote:
For exec() and system(), we don't send any input and only capture stdout. So, everything except the stdout fileno can be closed-on-exec. The user can do the usual 2>&1 trick to get the stderr output as we run their command using the shell.
Unless I'm missing something, the post I sent illustrates an example where a file descriptor other than 0/1/2 is being used to communicate between the parent process and the child process. I don't think that close-on-exec on the fd's before exec() is any different than simply close()ing before we exec(), so I think that this five year old issue would surface if we go for that solution. Back then, we couldn't come up with a good solution for this issue, and we simply disabled closing fd's on exec. We could alter this behavior to be optional, through php.ini, and yes, I don't particularly like this solution either, but I don't have any better in mind right now... Zeev

« previous php.internals (#2098) next »