composer require topthink/think-swoole
使用composer 安装依赖的时候抛出问题
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- topthink/think-swoole[v3.1.0, ..., v3.1.3] require ext-swoole >=4.4.8 -> i
t is missing from your system. Install or enable PHP's swoole extension.
- Root composer.json requires topthink/think-swoole ^3.1.0 -> satisfiable by
topthink/think-swoole[v3.1.0, v3.1.1, v3.1.2, v3.1.3].
To enable extensions, verify that they are enabled in your .ini files:
- C:\phpStudy\PHPTutorial\php\php-7.1.13-nts\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP
in CLI mode.
解决方案:
引包的时候带上 --ignore-platform-reqs
如:
composer require topthink/think-swoole --ignore-platform-reqs
参数说明
--ignore-platform-reqs: ignore all platform requirements (php
, hhvm
, lib-*
and ext-*
) and force the installation even if the local machine does not fulfill these. See also the platform
config option
忽略所有平台要求(php,hhvm,lib- *和ext- *)并强制安装,即使women 我们的本地计算机不满足这些要求。