Re: You should not have to choose

From: Date: Fri, 19 Nov 1999 13:11:41 +0000
Subject: Re: You should not have to choose
References: 1  Groups: php.dev php.version4 
Request: Send a blank email to php-dev+get-12762@lists.php.net to get a copy of this message
On Sat, 20 Nov 1999, Joel Jacobson wrote: > Hi. > > In some situations you have to choose if you want to use the cgi-version > of PHP or the apache module. > I don't think this is good. You should be able to do everything no > matter what kind of PHP version you use. > > For an example, by using the cgi-version and suEXEC it's possible to: > 1) Run PHP-scripts with the owners UID. > > But it's not possible to: > 1) Send headers like HTTP 401, because Apache will add Content-type: > text/html before your HTTP-header. > 2) Use PHP-scripts that uses the variable $SCRIPT_NAME. > 3) Achieve the same performence as when using the mod_php version. > The HTTP question can be solved by: > 1) Renaming the php binary to nph-php, but then you will have to: > 2) Create headers for ALL you scripts, and that's not the easiest thing > in the world, the headers are not the same in every situation. Short answer: "Life's a bitch". Detailed answer: You're wrong, there's no way of solving this. Some basic knowledge of UNIX would hint you that you cannot in any way change between user-id's, back and forth, without forking processes. And avoiding process forking is exactly what the module version of PHP is all about. As for the other way around - there's actually a bit of a point there - theoretically, it might be possible to write a module that would 'cooperate' with the PHP CGI to provide HTTP authentication. I'm not fluent enough with Apache's internals to know if that's practical or not, but frankly, even if it is, it won't be that great anyway. People who can compile modules into their Apache server are unlikely to be willing to give up the huge performance gains just to be able to do HTTP authentication through PHP. > And if the suEXEC feature existed in the module version of PHP, many > ISPs would stop using the cgi-version. Then the statistics of how many > users PHP has would become more reliable. As I said, suexec for a module is a self-contradicting sentence, regardless of what you're talking about; It only has to do with the basic way UNIX works - you can't have it both ways. > This is a difficult problem to solve, I know, but I think the great > developers of PHP can do it! No doubt about it. Undoubtfully, even if we were geniuses, you can't make the impossible. Zeev -- ----------------------------------------------------- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#12762) next »