gpt4 book ai didi

php - 如何在 macOS High Sierra 上安装 PHP GMP?

转载 作者:行者123 更新时间:2023-12-02 01:31:43 27 4
gpt4 key购买 nike

我正在尝试安装并启用 PHP 的 GMP 扩展。

Mac OS High Sierra 10.13.5
PHP Version: 7.1.16
Composer version: 1.6.5
Homebrew version: 1.6.9

当我运行composer install时遇到此错误。

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested PHP extension ext-gmp * is missing from your system. Install or enable PHP's gmp extension.

composer.json 依赖于 "ext-gmp": "*" 。我尝试过以下操作:

  1. brew install homebrew/php/php70-gmp
  2. brew 安装 gmp
  3. brew 安装 homebrew/homebrew-core/php70-gmp
  4. 更改了 php.ini 以启用 extension=php_gmp.dll

我在安装 Composer 时仍然遇到相同的错误。谁能帮我解决这个问题吗?

最佳答案

重新开始。安装 PHP 7

brew 安装 php@7.1

将 php 路径添加到 ~/.bash_profile~/.zshrc :

export PATH="/usr/local/opt/php@7.1/bin:$PATH"

然后源文件,启动php并检查gmp是否已加载

brew services start php@7.1
source ~/.zshrc
php -info | grep "GMP"

再试一次

关于php - 如何在 macOS High Sierra 上安装 PHP GMP?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51097508/

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