附录 G. 配置选项

目录
核心配置选项列表

核心配置选项列表

下面是 PHP 的 configure 脚本使用的部分选项的列表,用于类 Unix 环境的编译。大部分配置选项在扩展模块参考页面适当的位置列出,而不是在这里。要查看所有可用配置选项的列表,在运行 autoconf 命令后在 PHP 的源代码目录运行 ./configure --help (参见安装章节)。您也可以阅读 GNU configure 文档以获得有关 configure 命令的更详细信息,例如 --prefix=PREFIX

注: 这些选项只用在编译的时候。如果您想要修改 PHP 的运行时配置,请阅读运行时配置

在 PHP 4 中的配置选项

注: 这些选项仅适用于 PHP 4.1.0 以上版本。尽管某些选项可以用在较旧版本的 PHP 4,甚至 PHP 3,如果您想编译旧版本的 PHP,请注意有些选项不可用。

杂项选项

--enable-debug

编译时加入调试符号。

--with-layout=TYPE

设置被安装文件的布局。TYPE 是 PHP (默认) 或 GNU。

--with-pear=DIR

在 DIR (默认为 PREFIX/lib/php) 中安装 PEAR。

--without-pear

不安装 PEAR。

--enable-sigchild

使用 PHP 自带的 SIGCHLD 处理器。

--disable-rpath

进用在搜索路径中传递其他运行库。

--enable-libgcc

启用 libgcc 的精确链接。

--enable-php-streams

包含试验性的 PHP 流。不要使用这个选项,除非您要测试代码!

--with-zlib-dir[=DIR]

定义 zlib 的安装目录。

--enable-trans-sid

启用透明 session id 传输。仅适用于 PHP 4.1.2 或更低版本。PHP 4.2.0 以后,透明 sid 功能默认被编译其中。

--with-tsrm-pthreads

使用 POSIX 线程 (默认)。

--enable-shared[=PKGS]

编译共享库 [默认=是]。

--enable-static[=PKGS]

编译静态库 [默认=是]。

--enable-fast-install[=PKGS]

为快速安装优化 [默认=是]。

--with-gnu-ld

假设 C 编译器使用 GNU ld [默认=否]。

--disable-libtool-lock

阻止锁 (可能破坏平行编译)。

--with-pic

尝试仅使用 PIC/非 PIC 对象 [默认=都使用]。

--enable-memory-limit

编译内存限制支持功能。

--disable-url-fopen-wrapper

进用 URL 形式的 fopen 包裹器。该包裹器允许通过 HTTP 或者 FTP 访问文件。

--enable-versioning

仅导出必须的符号。查看 INSTALL 文件以获得更多信息。

--with-imsp[=DIR]

包含 IMSP 支持 (DIR 是 IMSP 的 include 目录和 libimsp.a 所在目录)。此选项仅在 PHP 3 中有效!

--with-mck[=DIR]

包含 Cybercash MCK 支持。DIR 是 cybercash mck 的编译目录,默认为 /usr/src/mck-3.2.0.3-linux。更多帮助情查看 extra/cyberlib 内的文件。此选项仅在 PHP 3 中有效!

--with-mod-dav=DIR

通过 Apache 的 mod_dav 实现对 DAV 的支持。DIR 是 mod_dav 的安装目录 (仅对以 Apache 模块方式安装的 PHP 有效)。此选项仅在 PHP 3 中有效!

--enable-debugger

编译远程调试功能。此选项仅在 PHP 3 中有效!

--enable-versioning

利用 Solaris 2.x 和 Linux 提供的版本 (versioning) 和范围 (scoping)。此选项仅在 PHP 3 中有效!

PHP 选项

--enable-maintainer-mode

启用后使得规则和依赖关系 (和有时的混乱) 临时对安装程序不再有用。

--with-config-file-path=PATH

设置 php.ini 的搜索路径。默认为 PREFIX/lib。

--enable-safe-mode

默认启用安全模式。

--with-exec-dir[=DIR]

在安全模式时仅允许在 DIR 目录中执行。默认目录为 /usr/local/php/bin。

--enable-magic-quotes

默认启用 magic quotes。

--disable-short-tags

默认仅用短形式的开始标签 <? 。

SAPI options

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

--with-aolserver=DIR

Specify path to the installed AOLserver.

--with-apxs[=FILE]

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.

--with-apache[=DIR]

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

--with-mod_charset

Enable transfer tables for mod_charset (Russian Apache).

--with-apxs2[=FILE]

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

--with-caudium=DIR

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

--disable-cli

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-embed[=TYPE]

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

--with-fhttpd[=DIR]

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

--with-isapi=DIR

Build PHP as an ISAPI module for use with Zeus.

--with-nsapi=DIR

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

--with-phttpd=DIR

No information yet.

--with-pi3web=DIR

Build PHP as a module for use with Pi3Web.

--with-roxen=DIR

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

--enable-roxen-zts

Build the Roxen module using Zend Thread Safety.

--with-servlet[=DIR]

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.

--with-thttpd=SRCDIR

Build PHP as thttpd module.

--with-tux=MODULEDIR

Build PHP as a TUX module (Linux only).

--with-webjames=SRCDIR

Build PHP as a WebJames module (RISC OS only)

--disable-cgi

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

--enable-force-cgi-redirect

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

--enable-discard-path

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.

--with-fastcgi

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

--enable-fastcgi

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

--disable-path-info-check

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.