Le sam 04/01/2003 ā 08:15, Marcus Börger a écrit :
> >What happens when a user wants to install *both* php-cli and php-cgi?
> >You cannot have two files with the same name, either in the same RPM, or
> >in two different RPMS... This is not RPM specific, since it will create
> >the same problem with apt, pkgtool, or others.
> But why would he want to? AFAIK Mandrake uses php as an apache module
> and CLI can be used on the commandline. If the user still wants to have CGI
> by a RPM then i would go for naming it to whatever name you like different 
> from
> that of the executable in the CLI RPM. Since RPM can handle all installation
> problems everything is fine then.

Concrete example from our demanding users:

If someone wants to have Apache running PHP, but provide secure PHP in a
chrooted environment for users home directories, they use cgiwrap, thus
php-cgi. But if they use PEAR and php-gtk as well, they'll need the
php-cli.

What you're suggesting is that, when both cgi and cli are installed, the
cli version is called php, and the php-cgi is called something else.

This creates these problems:
- If someone used the cgi version before, it will no longer work, since
the php-cli doesn't write the headers
- If someone used the cgi version in command-line mode, and install the
new cli version, some scripts will be broken, because of the way it does
not change directories before executing the script.

So the default behavior is to have php-cgi, and have some additional
steps to have the CLI. In the source edition, you have to do "make
install-cli", in Mandrake, you'll have to do "rpm -i php-cli".

So what I'll do is the following:
- The standard php binary will be the CGI version, will be called
php-cgi, and have a priority of 20.
- There will be an additional php-cli package, and will have a priority
of 10.
- I will use the "update-alternatives" method to provide a symbolic link
to /usr/bin/php. If only one package is installed, calling PHP will call
the right one. If both are installed, calling php will translate to
php-cgi, which has the highest priority. Users who have both packages
will still be able to chose if they give the proper binary name.

Does this make sense to you? 

Jean-Michel


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to