Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg

PHP : Appendices : Configure options

Appendix H. Configure options

List of core configure options

Below is a partial list of configure options used by the PHP configure scripts when compiling in Unix-like environments. Most configure options are listed in their appropriate locations on the extension reference pages and not here. For a complete up-to-date list of configure options, run ./configure --help in your PHP source directory after running autoconf (see also the Installation chapter). You may also be interested in reading the » GNU configure documentation for information on additional configure options such as --prefix=PREFIX.


These are only used at compile time. If you want to alter PHP's runtime configuration, please see the chapter on Runtime Configuration.

Configure Options in PHP 4


These options are only used in PHP 4 as of PHP 4.1.0. Some are available in older versions of PHP 4, some even in PHP 3, some only in PHP 4.1.0. If you want to compile an older version, some options will probably not be available.

Misc options


Compile with debugging symbols.


Sets how installed files will be laid out. Type is one of PHP (default) or GNU.


Install PEAR in DIR (default PREFIX/lib/php).


Do not install PEAR.


Enable PHP's own SIGCHLD handler.


Disable passing additional runtime library search paths.


Enable explicitly linking against libgcc.


Include experimental PHP streams. Do not use unless you are testing the code!


Define the location of zlib install directory.


Enable transparent session id propagation. Only valid for PHP 4.1.2 or less. From PHP 4.2.0, trans-sid feature is always compiled.


Use POSIX threads (default).


Build shared libraries [default=yes].


Build static libraries [default=yes].


Optimize for fast installation [default=yes].


Assume the C compiler uses GNU ld [default=no].


Avoid locking (might break parallel builds).


Try to use only PIC/non-PIC objects [default=use both].


Compile with memory limit support.


Disable the URL-aware fopen wrapper that allows accessing files via HTTP or FTP.


Export only required symbols. See INSTALL for more information.


Include IMSp support (DIR is IMSP's include dir and libimsp.a dir). PHP 3 only!


Include Cybercash MCK support. DIR is the cybercash mck build directory, defaults to /usr/src/mck- for help look in extra/cyberlib. PHP 3 only!


Include DAV support through Apache's mod_dav, DIR is mod_dav's installation directory (Apache module version only!) PHP 3 only!


Compile with remote debugging functions. PHP 3 only!


Take advantage of versioning and scoping provided by Solaris 2.x and Linux. PHP 3 only!

PHP options


Enable make rules and dependencies not useful (and sometimes confusing) to the casual installer.


Sets the path in which to look for php.ini, defaults to PREFIX/lib.


Enable safe mode by default.


Only allow executables in DIR when in safe mode defaults to /usr/local/php/bin.


Enable magic quotes by default.


Disable the short-form <? start tag by default.

SAPI options

The following list contains the available SAPI&s (Server Application Programming Interface) for PHP.


Specify path to the installed AOLserver.


Build shared Apache module. FILE is the optional pathname to the Apache apxs tool; defaults to apxs. Make sure you specify the version of apxs that is actually installed on your system and NOT the one that is in the apache source tarball.


Build a static Apache module. DIR is the top-level Apache build directory, defaults to /usr/local/apache.


Enable transfer tables for mod_charset (Russian Apache).


Build shared Apache 2.0 module. FILE is the optional pathname to the Apache apxs tool; defaults to apxs.


Build PHP as a Pike module for use with Caudium. DIR is the Caudium server dir, with the default value /usr/local/caudium/server.


Available with PHP 4.3.0. Disable building the CLI version of PHP (this forces --without-pear). More information is available in the section about Using PHP from the command line.


Enable building of the embedded SAPI library. TYPE is either shared or static, which defaults to shared. Available with PHP 4.3.0.


Build fhttpd module. DIR is the fhttpd sources directory, defaults to /usr/local/src/fhttpd. No longer available as of PHP 4.3.0.


Build PHP as an ISAPI module for use with Zeus.


Specify path to the installed Netscape/iPlanet/SunONE Webserver.


No information yet.


Build PHP as a module for use with Pi3Web.


Build PHP as a Pike module. DIR is the base Roxen directory, normally /usr/local/roxen/server.


Build the Roxen module using Zend Thread Safety.


Include servlet support. DIR is the base install directory for the JSDK. This SAPI requires the java extension must be built as a shared dl.


Build PHP as thttpd module.


Build PHP as a TUX module (Linux only).


Build PHP as a WebJames module (RISC OS only)


Disable building CGI version of PHP. Available with PHP 4.3.0.


Enable the security check for internal server redirects. You should use this if you are running the CGI version with Apache.


If this is enabled, the PHP CGI binary can safely be placed outside of the web tree and people will not be able to circumvent .htaccess security.


Build PHP as FastCGI application. No longer available as of PHP 4.3.0, instead you should use --enable-fastcgi.


If this is enabled, the CGI module will be built with support for FastCGI also. Available since PHP 4.3.0


If this is disabled, paths such as /info.php/test?a=b will fail to work. Available since PHP 4.3.0. For more information see the » Apache Manual.

Code Examples / Notes » configure


[Editor's note: The reason why some general options for the "configure" scripts are not documented is that said script is part of the GNU autoconf tools, and as such its general options are documented elsewhere, e.g.: and Some are also documented in the INSTALL file that comes with the source distribution.]
The --prefix=PREFIX configure option isn't mentioned here. It apparently defaults to /usr/local, and sets the position of the php includes and libs. (in PREFIX/include/php and PREFIX/lib/php)

tysonlt from web_spamoff_media com au

RE: Servlet support, I found that you need to configure --with-servlet=/usr/local/tomcat/common.
I found checking the configure script (always a good idea) that it looks for {dir_prefix}/lib/servlet.jar file, and this is found in the tomcat/common directory.
Hope this helps a bit!


Note: PHP5 has a zillion dependencies on libxml, it is not practical to disable it, you must install it.
libxml can be found here:
But this is actualy a good thing; "Almost everything regarding XML support was rewritten for PHP 5".
For more info see:


If you're trying to build with --with-imap and your uw-imap stuff is built SSLTYPE=nopwd then you will fail the "Checking if IMAP works" check if you don't also build with --with-imap-ssl
Another hour and a half of my life lost to find that one.

jovcic ate gseis stop ucla stop edu

If you'e compiling a shared extension (e.g. pspell) whose libs & headers are not in the usual place, use the following:
Took me forever to figure out, since Google had no answer for me.


If you are building with --with-pgsql=/some/dir, make sure that you still have libpq loaded up by ldconfig.  I compiled and installed postgres from the tarball and then had to manually create the symlinks in /usr/local/lib.  In particular, after you have built and installed postgres, you need to do the following (presuming you installed to /usr/local/pgsql):
# cd /usr/local/lib
# ln -s ../pgsql/lib/
# ln -s ../pgsql/lib/
# ln -s ../pgsql/lib/
# ldconfig
/usr/local/lib needs to be listed in /etc/, but it should already be there on most systems.  The above notes all apply to Linux only, but may be useful on other platforms as well.


If some options do not become active after doing a configure; make; make install, try to do a make clean after configure. That worked for me when enabling memory limts (--enable-memory-limit).


I tried compiling PHP from source with PostgreSQL support (./configure --with-pgsql=/usr/local/pgsql) and ran into a bunch of problems when trying to 'make'. The problem was that some of the PostgreSQL headers were not installed by default when I installed PostgreSQL from source. When installing PostgreSQL make sure you 'make install-all-headers' after you 'make install'.


--enable-sigchild is only relevent to users of Oracle who are having <defunc> processes.

16-jan-2004 11:33

>/usr/local/lib needs to be listed in /etc/, but it should already
>be there on most systems.  The above notes all apply to Linux only,
>but may be useful on other platforms as well
It is much simpler just to put /usr/local/pgsql/lib into /etc/ and then run ldconfig.

Change Language

Follow Navioo On Twitter
History of PHP and related projects
Migrating from PHP 5.1.x to PHP 5.2.x
Migrating from PHP 5.0.x to PHP 5.1.x
Migrating from PHP 4 to PHP 5
Migrating from PHP 3 to PHP 4
Migrating from PHP/FI 2 to PHP 3
Debugging PHP
Configure options
php.ini directives
List of Supported Timezones
Extension Categorization
List of Function Aliases
List of Reserved Words
List of Resource Types
List of Supported Protocols/Wrappers
List of Available Filters
List of Supported Socket Transports
PHP type comparison tables
List of Parser Tokens
Userland Naming Guide
eXTReMe Tracker