php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60144 php-cgi not created when compiled with --enable-fpm
Submitted: 2011-10-26 20:01 UTC Modified: 2011-10-27 17:29 UTC
From: napsty at gmail dot com Assigned:
Status: Not a bug Package: FPM related
PHP Version: 5.3.8 OS: Debian Squeeze
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: napsty at gmail dot com
New email:
PHP Version: OS:

 

 [2011-10-26 20:01 UTC] napsty at gmail dot com
Description:
------------
I'm not sure if this is a compile bug or if there's missing some important information in the documentation. However it's a case which should be looked at.

When compiling PHP with the option '--enable-fpm', the cli binary (php) is created, but the cgi binary (php-cgi) is not created.
Either there's a problem in the creation of the binaries or the documentation should be updated with this information.

I've found bug report #53271 which informs about this problem but it is shown as 'fixed in trunk'. That was 5.3.3 at the time, meanwhile a new version from trunk should have been created if I'm not mistaken?

Test script:
---------------
#!/bin/sh
./configure --prefix=/usr \
--with-libdir=lib64 \
--with-config-file-path=/etc/apache2 \
--with-openssl \
--with-kerberos \
--with-zlib \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-gettext \
--with-imap \
--with-imap-ssl \
--enable-intl \
--enable-mbstring \
--with-mcrypt \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
--enable-soap \
--enable-sockets \
--with-iconv \
--with-xsl \
--enable-zip \
--enable-fpm

Expected result:
----------------
All binaries should be created (php, php-cgi, php-fpm).

php-5.3.8 # ll sapi/cgi/
total 29M
-rw-r--r-- 1 someuser someuser  66K Aug 11 08:38 cgi_main.c
-rw-r--r-- 1 root      root       310 Oct 26 21:57 cgi_main.lo
-rw-r--r-- 1 root      root      141K Oct 26 21:57 cgi_main.o
-rwxr-xr-x 1 someuser someuser 1.7K Sep 27  2007 CHANGES
-rw-r--r-- 1 someuser someuser 3.1K Oct  1  2007 config9.m4
-rw-r--r-- 1 someuser someuser  322 Oct  5  2007 config.w32
-rw-r--r-- 1 someuser someuser   72 Feb 14  2007 CREDITS
-rw-r--r-- 1 someuser someuser  30K Jan 19  2011 fastcgi.c
-rw-r--r-- 1 someuser someuser 4.5K Jan  1  2011 fastcgi.h
-rw-r--r-- 1 root      root       308 Oct 26 21:57 fastcgi.lo
-rw-r--r-- 1 root      root       88K Oct 26 21:57 fastcgi.o
-rw-r--r-- 1 someuser someuser   68 Sep 26  2007 Makefile.frag
-rwxr-xr-x 1 root      root       28M Oct 26 21:57 php-cgi
-rw-r--r-- 1 someuser someuser    0 Sep 26  2007 php.sym
-rw-r--r-- 1 someuser someuser 6.0K Jul 24  2006 README.FastCGI
drwxr-xr-x 2 someuser someuser 4.0K Aug 23 11:31 tests

Actual result:
--------------
After make, only cli (php) and and php-fpm binaries are created.

php-5.3.8 # ll sapi/cgi/
total 144K
-rw-r--r-- 1 someuser someuser  66K Aug 11 08:38 cgi_main.c
-rwxr-xr-x 1 someuser someuser 1.7K Sep 27  2007 CHANGES
-rw-r--r-- 1 someuser someuser 3.1K Oct  1  2007 config9.m4
-rw-r--r-- 1 someuser someuser  322 Oct  5  2007 config.w32
-rw-r--r-- 1 someuser someuser   72 Feb 14  2007 CREDITS
-rw-r--r-- 1 someuser someuser  30K Jan 19  2011 fastcgi.c
-rw-r--r-- 1 someuser someuser 4.5K Jan  1  2011 fastcgi.h
-rw-r--r-- 1 someuser someuser   68 Sep 26  2007 Makefile.frag
-rw-r--r-- 1 someuser someuser    0 Sep 26  2007 php.sym
-rw-r--r-- 1 someuser someuser 6.0K Jul 24  2006 README.FastCGI
drwxr-xr-x 2 someuser someuser 4.0K Aug 23 11:31 tests

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-26 21:27 UTC] sixd@php.net
-Package: *Compile Issues +Package: FPM related
 [2011-10-27 16:09 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2011-10-27 16:09 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

CGI is the default SAPI. If another SAPI is selected cgi won't be built. To force CGI there is --enable-cgi as option. CLI is an exception and controlled individually.
 [2011-10-27 17:29 UTC] napsty at gmail dot com
Hi Johannes,
Thanks but that doesn't work either:

./configure --prefix=/usr \
--with-libdir=lib64 \
--with-config-file-path=/etc/apache2 \
--with-openssl \
--with-kerberos \
--with-zlib \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-gettext \
--with-imap \
--with-imap-ssl \
--enable-intl \
--enable-mbstring \
--with-mcrypt \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
--enable-soap \
--enable-sockets \
--with-iconv \
--with-xsl \
--enable-zip \
--enable-cgi \
--enable-fpm

cgi binary is not created:

ll sapi/cgi/
total 144K
-rw-r--r-- 1 majordomo majordomo  66K Aug 11 08:38 cgi_main.c
-rwxr-xr-x 1 majordomo majordomo 1.7K Sep 27  2007 CHANGES
-rw-r--r-- 1 majordomo majordomo 3.1K Oct  1  2007 config9.m4
-rw-r--r-- 1 majordomo majordomo  322 Oct  5  2007 config.w32
-rw-r--r-- 1 majordomo majordomo   72 Feb 14  2007 CREDITS
-rw-r--r-- 1 majordomo majordomo  30K Jan 19  2011 fastcgi.c
-rw-r--r-- 1 majordomo majordomo 4.5K Jan  1  2011 fastcgi.h
-rw-r--r-- 1 majordomo majordomo   68 Sep 26  2007 Makefile.frag
-rw-r--r-- 1 majordomo majordomo    0 Sep 26  2007 php.sym
-rw-r--r-- 1 majordomo majordomo 6.0K Jul 24  2006 README.FastCGI
drwxr-xr-x 2 majordomo majordomo 4.0K Aug 23 11:31 tests


Also if I want to use php-cgi to pass it to the php-fpm daemon it kind of makes no sense to compile php twice.
 [2013-10-30 19:32 UTC] admin at franceserv dot fr
Greetings,

I confirm, it's a bug and even in 2013, 2 years after the last comment.

When i compile the latest PHP version 5.3.27 with :
./configure --enable-fpm --enable-cgi

--> php-cgi isn't build with php-fpm

But when i compile the latest PHP version 5.4.20 and 5.5.5 with exactly the same line :
./configure --enable-fpm --enable-cgi

--> php-cgi and php-fpm are built both in same time

The solution currently is to build 2x 5.3.21 with :
./configure --enable-cgi; make; make install
and after ./configure --enable-fpm; make; make install

So yes, it's a bug.
 [2013-11-04 15:21 UTC] ckubu at so36 dot net
I had a simular problem. php-cgi wasn't compiled, even without option '--enable-fpm'. It seems that configure option '--with-apxs2' also prevents php from compiling php-cgi.

My workaround was:

export PATH=<path-to-apache's-apxs>:$PATH
configure php without option '--with-apxs2'

Now php-cgi was build..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC