php-cgi seems to have vanished in PHP 5.3.1. I've tried both the --enable-cgi and --disable-cli flags for ./configure, but it doesn't create a binary under the sapi/cgi subdirectory.
5 Answers
I realise I'm very late to the party on this, but I think PHP FPM (FastCGI Process Manager) is the replacement.
You need to use PHP 5.3.3 and use the --enable-fpm
configure flag, or use the patch at the php-fpm website for earlier versions. An executable called php-fpm gets created in sapi/fpm.
It appears that php-fpm and php-cgi are mutually exclusive -- that is, if you use the --enable-fpm
configure option, it will not build the php-cgi executable.
If you need both present, a workaround is to build without --enable-fpm
, store away a copy of the php-cgi
executable, re-configure with --enable-fpm
, and re-build.
I solved same problem.
Looks like when you try to ./configure
you use --with-apxs
-that block to compile php-cgi version. Simply not set this.
If you are using Ubuntu I can see that the application is named as "php5-cgi"
-
No, I am using RHEL4 (which does not have a PHP5 RPM) and need to compile from source.– geoffleeJan 20, 2010 at 16:04
I use the following switches for ./configure, however this is for CentOS 5 and PHP 5.2.13, I hope this helps in some way:
./configure --prefix=$INSTALL_BASE \
--with-config-file-path=$INSTALL_BASE/etc/ \
--enable-force-cgi-redirect \
--enable-mbstring \
--enable-fastcgi \
--enable-gd-native-ttf \
--enable-ftp \
--enable-sockets \
--enable-wddx \
--enable-sqlite-utf8 \
--enable-mbstring \
--enable-mbregex \
--enable-calendar \
--enable-zip \
--with-libxml-dir=$INSTALL_BASE \
--with-freetype-dir=$INSTALL_BASE \
--with-openssl \
--with-mhash=$INSTALL_BASE \
--with-mcrypt=$INSTALL_BASE \
--with-zlib-dir=$INSTALL_BASE \
--with-bz2 \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-gd \
--with-iconv=$INSTALL_BASE \
--with-curl=$INSTALL_BASE \
--with-pgsql \
--with-gettext \
--with-imap=$INSTALL_BASE \
--with-imap-ssl=/usr \
--enable-bcmath \
--with-pear \
--with-xmlrpc