Red Hat Bugzilla – Bug 112497
Current version of php is the cgi version, instead of the cli version
Last modified: 2007-11-30 17:10:34 EST
Description of problem:
The Red Hat RPM currently installs the cgi version for no reason.
There are good reasons for it to use the command line version. For
instance, you cannot write to STDERR because it hasn't been defined or
Version-Release number of selected component (if applicable):
do a "php -v"
Steps to Reproduce:
1. php -v
2. Look at first line () and see if "cgi" or "cli"
PHP 4.3.3 (cgi) (built: Oct 21 2003 09:51:55)
PHP 4.3.3 (cli) (...)
There are some serious problems with the php.spec file that Red Hat
uses (no offense). A lot of the patches are no longer applicable and
the build procedure is suspect in its entirity.
For instance, during the build, you build the PHP system twice. This
dates back before PHP 4.2 when some modules couldn't be built unless
it was specified separately as "--enable-cgi". And since PHP 4.2 an
"--enable-cli" was introduced obviating the need for a cgi version of
PHP (you use the PHP Apache SAPI already).
Also, you manually construct the library dependencies in a strange
manner. I guess this dates back a long time ago when libtool was unstable.
I think it would be a good idea to start from scratch with FC1 and
then work out the bugs from there. The RH people have already got what
they believe to be a "stable enough" version of PHP running in RH with
a zillion back patches.
I'd be willing to help maintain this package for FC, but I'm not
familiar with the rules/procedures. If someone can send me e-mail
explaining how to help out (mailing lists, irc, cvs, etc.).
Patches: which do you think are "no longer applicable" exactly, and why?
CLI vs CGI SAPIs: thanks for the info, I've been meaning to look into
Building the library dependencies: I presume you are referring to the
LIBS="..." line? If so, yes, I totally agree: I removed this in the
4.3.4-2 package in Raw Hide a while back. The latest php source RPM
is available from
Helping out: the best way to help out is to file bugs on specific
problems, and attach any patches to the bugs. The web site has
information on mailing lists: http://fedora.redhat.com/participate/
I'm closing this bug since there is no specific issue to be addressed
here. Please do open bugs on any specific issues you have with the
To clarify: the CGI SAPI is built rather than CLI so that people can
use PHP as a CGI interpreter via shebang lines: this can be used via
suexec, for example, which the CLI version can't AFAIK. And there is
no way of building the CGI SAPI and an Apache SAPI in a single
configure invocation AFAICT. Again: please correct me/supply patches
if this is now possible.