macos brew install 怎么查看安装时选择了哪些选项

发布于 2022-09-06 21:18:48 字数 1937 浏览 25 评论 0

比如安装PHP,
我们会先通过命令brew options php71查看有哪些选项是可以选择的。

--with-cgi
        Enable building of the CGI executable (implies --without-fpm)
--with-debug
        Compile with debugging symbols
--with-embed
        Compile with embed support (built as a static library)
--with-enchant
        Build with enchant support
--with-gmp
        Build with gmp support
--with-homebrew-curl
        Include Curl support via Homebrew
--with-homebrew-libressl
        Include LibreSSL instead of OpenSSL via Homebrew
--with-homebrew-libxml2
        Include Libxml2 support via Homebrew
--with-homebrew-libxslt
        Include LibXSLT support via Homebrew
--with-httpd
        Enable building of shared Apache Handler module
--with-imap
        Include IMAP extension
--with-libmysql
        Include (old-style) libmysql support instead of mysqlnd
--with-mssql
        Include MSSQL-DB support
--with-pdo-oci
        Include Oracle databases (requries ORACLE_HOME be set)
--with-pear
        Build with PEAR
--with-phpdbg
        Enable building of the phpdbg SAPI executable
--with-postgresql
        Build with postgresql support
--with-thread-safety
        Build with thread safety
--with-webp
        Build with webp support
--without-bz2
        Build without bz2 support
--without-fpm
        Disable building of the fpm SAPI executable
--without-ldap
        Build without LDAP support
--without-legacy-mysql
        Do not include the deprecated mysql_ functions
--without-mysql
        Remove MySQL/MariaDB support
--without-pcntl
        Build without Process Control support
--without-unixodbc
        Build without unixODBC support
--HEAD
        Install HEAD version

比如我选择这样子安装:

brew install php71 --with-homebrew-curl --with-homebrew-libressl

然后过了一段时间,我发现还需要加一个参数--with-httpd,能不能不卸载直接加上这个选项?

如果必须卸载掉重新安装,
那我要怎么查看第一次安装时选择了哪些选项?还是只能凭记忆?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疧_╮線 2022-09-13 21:18:48

brew 是通过ruby脚本来完成安装管理的.

通过

brew edit php71

可以打开编辑器编辑相应的的安装脚本

通过查看/usr/local/Homebrew/Library/Taps/homebrew/homebrew-php/Formula/php71.rb 及其相关的依赖项目/usr/local/Homebrew/Library/Taps/homebrew/homebrew-php/Abstract/abstract-php.rb可以看到, 以php71为例, 脚本并不没有把相关的依赖项目--with-XXX保存到磁盘(方法 _install及 install_args).

所以不严密的结论是,默认情况下没有办法知道上次安装都有哪些选项.

可能通过

brew info php71

来查看依赖关系和可能选项.

因为一些选项是包的编译选项, 所以更改选项估计只能通过重装才行.

安装或系统改动保留脚本是个好习惯,记忆是不可靠的.
可以用CTRL>+R最近的输入历史, 或用history查看以往操作.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文