如何解决“laravel/horizon v1.1.0 需要 ext-pcntl * ->您的系统中缺少请求的 PHP 扩展 pcntl”?

当我在命令promp上运行时,存在这样的错误:composer install

  Problem 1
    - Installation request for laravel/horizon v1.1.0 -> satisfiable by laravel/horizon[v1.1.0].
    - laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.

  To enable extensions, verify that they are enabled in your .ini files:
    - C:\xampp-7.1\php\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

如何解决此错误?


答案 1

使用该选项运行作曲家,并指定和--ignore-platform-reqspcntlposix

composer install --ignore-platform-reqs

答案 2

根据接受的答案,但您可以将其添加到您的composer.json,这样您就不必一直运行--ignore-platform-reqs

"config": {
  "platform": {
    "ext-pcntl": "8.0",
    "ext-posix": "8.0"
  }
}

推荐