gpt4 book ai didi

php - pecl install - 如何指定选项?

转载 作者:行者123 更新时间:2023-12-05 02:57:19 25 4
gpt4 key购买 nike

我正在尝试使用 pecl 为 PHP 安装 event 扩展。在安装过程中,我收到几个提示:

Enable internal debugging in Event [no] : 
Enable sockets support in Event [yes] :
libevent installation prefix [/usr] :
Include libevent's pthreads library and enable thread safety support in Event [no] :
Include libevent protocol-specific functionality support including HTTP, DNS, and RPC [yes] :
Include libevent OpenSSL support [yes] :
PHP Namespace for all Event classes [no] :
openssl installation prefix [no] :

但这只发生在交互模式下。我需要在没有交互的情况下执行此操作,例如在 Dockerfile 中。默认值对我不起作用,因此我需要使用命令行选项更改它们。怎么办?

请记住,我需要对每个问题做出不同的回答,所以 yes '' | pecl install ... 根本不起作用。此外,其中一个问题需要一个路径,而不是是/否。

最佳答案

现在可以将配置选项传递给 pecl install通过--configureoptions .

您需要找到您的包的 package.xml 文件以查看哪些选项是可配置的。对于 event包,你会去这里:

https://bitbucket.org/osmanov/pecl-event/src/master/package.xml

搜索 <configureoption>标签,在本例中是:

<configureoption default="no" name="enable-event-debug" prompt="Enable internal debugging in Event"/>
<configureoption default="yes" name="enable-event-sockets" prompt="Enable sockets support in Event"/>
<configureoption default="/usr" name="with-event-libevent-dir" prompt="libevent installation prefix"/>
<configureoption default="no" name="with-event-pthreads" prompt="Include libevent's pthreads library and enable thread safety support in Event"/>
<configureoption default="yes" name="with-event-extra" prompt="Include libevent protocol-specific functionality support including HTTP, DNS, and RPC"/>
<configureoption default="yes" name="with-event-openssl" prompt="Include libevent OpenSSL support"/>
<configureoption default="no" name="with-event-ns" prompt="PHP Namespace for all Event classes"/>
<configureoption default="yes" name="with-openssl-dir" prompt="openssl installation prefix"/>

然后您可以像这样将这些选项传递给安装命令:

pecl install --configureoptions 'enable-event-debug="no" with-event-libevent-dir="/my/dir" with-event-ns="yes"' event

关于php - pecl install - 如何指定选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59820378/

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