[suPHP] SuPHP recursive forking

John Lightsey jd at cpanel.net
Mon Sep 29 17:10:04 CEST 2008


On Sep 26, 2008, at 9:41 PM, Jeremy Chadwick wrote:

> On Fri, Sep 26, 2008 at 06:40:44PM +0300, Jani Ollikainen wrote:
>> On Fri, Sep 26, 2008 at 10:20:09AM -0500, John Lightsey wrote:
>>> On a cPanel machine /usr/bin/php is the PHP CGI binary and /usr/ 
>>> local/
>>> bin/php is the PHP CLI binary.  In /opt/suphp/etc/suphp.conf the
>>> env_path is set to /bin:/usr/bin.
>>
>> In smart distributions php is the cli binary and php-cgi is the cgi
>> binary..
>
> Agreed/correct.
>
> On FreeBSD, the CLI is called /usr/local/bin/php, and the CGI is
> called /usr/local/bin/php5-cgi.  If an administrator doesn't know
> the difference, then they should be passing off such administrative
> tasks onto someone who does.

My understanding is that in the past FreeBSD wouldn't allow you to  
install the PHP 4 CLI and CGI binaries simultaneously, so it's still  
possible on an older FreeBSD machine that /usr/local/bin/php is the  
CGI binary.

>
>> If cPanel uses both cgi and cli with the name php, that's just nasty.
>> I think you should try to fix cPanel to have smarter naming of php  
>> binaries.
>
> Agreed.

The way we install it is a legacy issue originally intended to deal  
with PHP4's inability to install the PHP CGI and PHP CLI binaries in  
the same location.  PHP4 installs both the CLI and CGI binaries as  
just "php".  The PHP development team corrected that problem with  
PHP5, but we have many customers who still want to use 4 and have  
applications that are expecting the CGI and CLI binaries to be  
installed in those specific locations.

In the longer run we'd like to get these custom PHP installs out of  
the system paths entirely and just use a symlink for one version of  
the the CLI binary into /usr/bin/php.

If we're handing out blame though, I'd say that the bigger issue is  
that there shouldn't be separate CLI and CGI binaries to begin with.   
PHP has its own legacy problems to deal with though and this seems to  
be one of them.  Of course, deciding that "php" will only refer to the  
CLI binary after years of using it to refer to both the CLI and CGI  
binaries isn't a very safe approach to begin with.  They could have  
called it php-cli with PHP5 to avoid these name collisions.

J.D.



More information about the suPHP mailing list