https://www.kancloud.cn/thinkphp/think-swoole/722895#thinkswoole_42,
[root@VM_16_13_centos tp]# composer require topthink/think-swoole
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^3.0 for topthink/think-swoole
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- topthink/think-swoole v3.0.2 requires topthink/framework ^6.0.0 -> satisfiable by topthink/framework[6.0.x-dev, v6.0.0-rc2, v6.0.0-rc3] but these conflict with your requirements or minimum-stability.
- topthink/think-swoole v3.0.1 requires topthink/framework ^6.0.0 -> satisfiable by topthink/framework[6.0.x-dev, v6.0.0-rc2, v6.0.0-rc3] but these conflict with your requirements or minimum-stability.
- topthink/think-swoole v3.0.0 requires topthink/framework ^6.0.0 -> satisfiable by topthink/framework[6.0.x-dev, v6.0.0-rc2, v6.0.0-rc3] but these conflict with your requirements or minimum-stability.
- Installation request for topthink/think-swoole ^3.0 -> satisfiable by topthink/think-swoole[v3.0.0, v3.0.1, v3.0.2].
Installation failed, reverting ./composer.json to its original content.后面改了[root@VM_16_13_centos tp]# composer require topthink/think-swoole:2.0.x-dev --ignore-platform-reqs
Do not run Composer as root/super user! See https://getcomposer.org/root for details
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 8 installs, 0 updates, 0 removals
- Installing topthink/think-helper (v3.0.0): Downloading (100%)
- Installing topthink/think-queue (v2.0.4): Downloading (100%)
- Installing xavier/xcron-expression (0.11): Downloading (100%)
- Installing symfony/polyfill-util (v1.11.0): Loading from cache
- Installing symfony/polyfill-php56 (v1.11.0): Loading from cache
- Installing nikic/php-parser (v4.2.2): Loading from cache
- Installing jeremeamia/superclosure (2.4.0): Loading from cache
- Installing topthink/think-swoole (2.0.x-dev c0e227c): Cloning c0e227c0f9
Writing lock file
Generating autoload files就解决了上面的报错,但是启动的时候又报错
[root@VM_16_13_centos tp]# php think swoole
Starting swoole http server...
[2019-07-10 13:30:13 @23061.0] WARNING swShareMemory_mmap_create(:128): mmap(1412641536) failed, Error: Cannot allocate memory[12]
PHP Fatal error: Swoole\Table::create(): unable to allocate memory in /home/nginx/tp/vendor/topthink/think-swoole/src/CacheTable.php on line 33
[think\exception\ErrorException]
Swoole\Table::create(): unable to allocate memory
最佳答案