Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Which OS and what version of OS are you using ? – proy Jan 20 '10 at 15:05
RHEL4. (why is the a 15-character minimum on this comment box?!) – geofflee Jan 20 '10 at 16:05
up vote 4 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

If you are using Ubuntu I can see that the application is named as "php5-cgi"

share|improve this answer
No, I am using RHEL4 (which does not have a PHP5 RPM) and need to compile from source. – geofflee Jan 20 '10 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 \
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.