CakeFest 2024: The Official CakePHP Conference

核心配置选项列表

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

注意:

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

PHP 配置选项

杂项选项

--enable-debug

编译时加入调试符号。

--with-layout=TYPE

设置已安装文件的布局方式。TYPE 是 PHP(默认)或 GNU。请注意,如果在 PREFIX(默认)下安装 manpages,请选择 GNU 样式,以便在 manpath 实用程序的搜索路径中能够找到它们。

--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 的安装目录。

--with-tsrm-pthreads

使用 POSIX 线程(默认)。

--enable-shared[=PKGS]

编译共享库 [default=yes]。

--enable-static[=PKGS]

编译静态库 [default=yes]。

--enable-fast-install[=PKGS]

为快速安装优化 [default=yes]。

--with-gnu-ld

假设 C 编译器使用 GNU ld [default=no]。

--disable-libtool-lock

避免锁死(可能破坏并联的编译)。

--with-pic

尝试仅使用 PIC/非 PIC 对象 [default=use both]。

--enable-versioning

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

PHP 选项

--enable-maintainer-mode

对偶然安装一下的情形启用此选项,使得不检查编译规则和依赖关系。

--with-config-file-path=PATH

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

--disable-short-tags

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

--with-libdir

在 Unix 系统上指定库的目录,用于构建 PHP。对于 64 位系统,需要将此参数指定为 lib64,例如:--with-libdir=lib64

--enable-zts

启用线程安全。PHP 8.0.0 之前的非 Windows 系统上,该选项为 --enable-maintainer-zts

SAPI 选项

下面的列表包含 PHP 可用的 SAPI(服务器应用编程接口)。

--with-apxs[=FILE]

编译共享的 Apache 模块。FILE 是可选的 Apache apxs 工具的路径,默认指向 apxs。请确认指定的 apxs 已经安装在服务器中,并且它不是 Apache 源码包中的那个 apxs。

--with-apache[=DIR]

编译静态 Apache 模块。DIR 是 Apache 编译目录的顶层,默认为 /usr/local/apache

--with-mod_charset

启用 mod_charset 的转换表(俄文的 Apache 使用)。

--with-apxs2[=FILE]

编译共享的 Apache 2.0 模块。FILE 是可选的 Apache apxs 工具的路径,默认指向 apxs。

--disable-cli

禁止编译 PHP 的 CLI 版本(使用它将同时强制使用 --without-pear 选项)。更多信息请参阅 PHP 的命令行模式

--enable-phpdbg

启用 phpdbg 调试 SAPI 模块支持。

--enable-embed[=TYPE]

启用编译嵌入的 SAPI 库。TYPE 或者为 shared 或者为 static,默认为 shared

--with-servlet[=DIR]

包含 servlet 支持。DIR 是 JSDK 的安装目录。此 SAPI 要求 java 扩展必须作为共享模块编译到 PHP 中。

--disable-cgi

禁止编译 CGI 版本的 PHP。

这个选项也会启用 FastCGI。

add a note

User Contributed Notes 2 notes

up
8
atesin () gmail ! com
3 years ago
i'll answer myself (FINALLY!)

current "configure options" can be viewed with "php-config" shell script, aside with other compile time options too =D!!! ...

in some distributions it comes with the "php-devel" package... but until in this online manual "php-config" is mentioned in pecl extensions documentation (i couldn't find on pecl site), idk if that "php-devel" has something to do with this

... however i noticed they are literal strings inside the script, i hope the script itself were built together with php compilation o_O

in the previous page "configure options" (link shown above ^), there is an editor note with additional info about it
up
3
atesin () gmail ! com
3 years ago
please somebody tell me how to display configure options used in php actual binary

it was shown in phpinfo() some years before, it was very useful, specially with 'phpize' recompilation and to enable some pecl/pear module :/

please tell me also which ctriteria had php guys used to suddenly decided to hide (or obfuscate) this info :/

thanks in advance
To Top