MAMP Pro 安装Swoole日志

通过pecl 安装

参考官方文档

pecl install swoole

问题: fatal error: ‘openssl/ssl.h‘ file not found

如果没安装openssl的话, 先安装openssl

`brew install openssl`

如果已安装 , 则做一个链接

ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl

问题:#error "Enable openssl support, require openssl library"

安装提示 enable openssl support?[no] 时 , 直接使用brew安装的openssl目录即可 , 输入

yes --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2q/

参考链接: https://www.cnblogs.com/xiaobaiskill/p/11062024.html

成功信息

Build process completed successfully
Installing '/Applications/MAMP/bin/php/php7.3.8/include/php/ext/swoole/config.h'
Installing '/Applications/MAMP/bin/php/php7.3.8/lib/php/extensions/no-debug-non-zts-20180731/swoole.so'
install ok: channel://pecl.php.net/swoole-4.4.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=swoole.so" to php.ini

按照提示将extension=swoole.so 添加进php.ini中即可

安装成功后依赖提示缺少swoole

网上的坑友一般遇到的问题有

  1. phpinfo() 没有swoole
  2. php -m 没有swoole

而我遇到的情况是, 这两者都有, 但是通过composer install swoole项目时, 依然提示缺少swoole库

php --ri swool 也找不到

$ php --ri swool
Extension 'swool' not present.

不过最终还是按照官方文档 解决的

通过

php -i|grep php.ini
或者
php --ini

发现,虽然MAMP pro 中配置了extension=swoole.so , 但是配置的是/Library/Application Support/appsolute/MAMP PRO/conf/php7.3.8.ini 文件

Configuration File (php.ini) Path: 指向的是/Applications/MAMP/bin/php/php7.3.8/conf/php.ini 配置文件,在此文件中添加extension=swoole.so后,

久违的一幕终于出现了

CrocutaxdeMacBook-Pro:011_demo crocutax$ composer require easyswoole/easyswoole=3.x
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 17 installs, 0 updates, 0 removals
  - Installing easyswoole/spl (1.2.4): Downloading (100%)
  - Installing symfony/polyfill-util (v1.12.0): Downloading (100%)
  - Installing symfony/polyfill-php56 (v1.12.0): Downloading (100%)
  - Installing nikic/php-parser (v4.2.4): Downloading (100%)
  - Installing jeremeamia/superclosure (2.4.0): Downloading (100%)
  - Installing easyswoole/utility (1.1.1): Downloading (100%)
  - Installing easyswoole/component (1.9.2): Downloading (100%)
  - Installing easyswoole/task (1.0.4): Downloading (100%)
  - Installing easyswoole/config (1.0.3): Downloading (100%)
  - Installing dragonmantank/cron-expression (v2.3.0): Downloading (100%)         - Installing easyswoole/log (1.0.3): Downloading (100%)
  - Installing easyswoole/trigger (1.0.0): Downloading (100%)
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing nikic/fast-route (v1.3.0): Downloading (100%)
  - Installing easyswoole/validate (1.2.0): Downloading (100%)
  - Installing easyswoole/http (1.3.3): Downloading (100%)
  - Installing easyswoole/easyswoole (3.3.0): Downloading (100%)
Writing lock file
Generating autoload files

虽然此时php --ri swool 依然找不到swoole, 但是先不管了. 后期再说吧.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Crocutax

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值