Mac PHP5.6.30编译安装swoole扩展,安装完成之后,执行命令:


lib git:(stable) php -v                

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php56/5.6.30_6/lib/php/extensions/no-debug-non-zts-20131226/swoole.so' - dlopen(/usr/local/Cellar/php56/5.6.30_6/lib/php/extensions/no-debug-non-zts-20131226/swoole.so, 9): no suitable image found.  Did find:

/usr/local/Cellar/php56/5.6.30_6/lib/php/extensions/no-debug-non-zts-20131226/swoole.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php56/5.6.30_6/lib/php/extensions/no-debug-non-zts-20131226/swoole.so' - dlopen(/usr/local/Cellar/php56/5.6.30_6/lib/php/extensions/no-debug-non-zts-20131226/swoole.so, 9): no suitable image found.  Did find:

/usr/local/Cellar/php56/5.6.30_6/lib/php/extensions/no-debug-non-zts-20131226/swoole.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 in Unknown on line 0

PHP 5.6.30 (cli) (built: Mar 11 2017 09:56:27)

Copyright (c) 1997-2016 The PHP Group

Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies



折腾了很久,1.9.3版本的so文件被我删了重新装了一个1.8.11的,就正常了。所以初步估计是版本问题。所说pecl官方文档中写明支持1.9.3 支持5.3以上版本,可能有其他不兼容的吧。


最终查看当前的Swoole版本及相关信息:

➜  swoole php --ri swoole

swoole

swoole support => enabled

Version => 1.8.11

Author => tianfeng.han[email: mikan.tenny@gmail.com]

kqueue => enabled

rwlock => enabled

async http/websocket client => enabled

pcre => enabled

zlib => enabled

Directive => Local Value => Master Value

swoole.aio_thread_num => 2 => 2

swoole.display_errors => On => On

swoole.use_namespace => Off => Off

swoole.message_queue_key => 0 => 0

swoole.unixsock_buffer_size => 8388608 => 8388608

最终解决方案:换个低版本试试看


本文链接二维码可以保存在本地:保存

| 浏览 (6495) | (0) | (0) | | 2017-12-11 17:26:01 |


相关文章

  1. Mac安装Swoole扩展phpize 时 Cannot find autoconf 解决方法
  2. Laravel 数据库事务
  3. PHP贷款等额本息、等额本金计算月供还款计划公式
  4. Laravel 关闭过滤排除部分路由VerifyCsrfToken 验证
  5. Laravel Horizon监控Redis队列queue
  6. Laravel 的任务调度计划任务的测试