gpt4 book ai didi

php - 如何将配置选项传递给 phpenv install

转载 作者:行者123 更新时间:2023-12-02 00:47:18 26 4
gpt4 key购买 nike

我想通过 phpenv 安装 PHP启用 ZTS 和调试符号。在手动安装中,我会通过传递 --enable-debug and --enable-maintainer-zts 来完成此操作到配置选项。

如何将这些选项传递给 phpenv?

最佳答案

键入 phpenv install --help 打印

Usage: phpenv install [--ini|-i <environment>] <version>
phpenv install [--ini|-i <environment>] <definition-file>
phpenv install -l|--list
phpenv install -V|--version

-l/--list List all available versions
-V/--version Show version of php-build

For detailed information on installing PHP versions with
php-build, including a list of environment variables for adjusting
compilation, see: https://github.com/php-build/php-build

所以没有命令行标志来传递这些选项。但最后一段重定向到 https://github.com/php-build/php-build ,这是 phpenv 用来安装 php 的。该 repo 协议(protocol)中的自述文件没有列出任何环境变量,而是深入研究了 source codethe man files揭示以下内容:

ENVIRONMENT

  • PHP_BUILD_DEBUG, set this to yes to trigger a set -x call. This echo's all issued shell commands of the script.
  • PHP_BUILD_XDEBUG_ENABLE=on|off (default: on), set to off to comment out the lines which enable XDebug, in the generated xdebug.ini.
  • PHP_BUILD_CONFIGURE_OPTS, list of additional configure options.
  • PHP_BUILD_ZTS_ENABLE=on|off (default: off), enables Zend Thread Safety for builds
  • PHP_BUILD_INSTALL_EXTENSION see [EXTENSION] section.

因此要使用 ZTS 和 Debug模式安装 PHP,需要使用

PHP_BUILD_ZTS_ENABLE=yes \
PHP_BUILD_CONFIGURE_OPTS="--enable-debug" \
phpenv install 7.1.0

关于php - 如何将配置选项传递给 phpenv install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42808399/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com