PHP 环境安装 msgpack 2.0.2 失败的排查
今天中午同事在安装 msgpack-2.0.2 时报错,
检查后发现我的 php 版本是 5.6 的版本,不支持 Zend/zend_smart
并且官方文档也指定了版本要求最低要求 7.0
使用 pecl 安装方式,直接提升需要使用 php7.0 以上的版本.
[root@web msgpack-2.0.2]# pecl install msgpack
pecl/msgpack requires PHP (version >= 7.0.0), installed version is 5.6.30
No valid packages found
install failed
编译安装时 make 报错
In file included from /root/msgpack-2.0.2/msgpack.c:16:0:
/root/msgpack-2.0.2/php_msgpack.h:4:56: fatal error: Zend/zend_smart_str.h: No such file or directory
#include "Zend/zend_smart_str.h" /* for smart_string */
^
compilation terminated.
make: *** [msgpack.lo] Error 1
除了升级 php7 或者安装低版本的 msgpack 暂时还不知道解决办法!
补充说明:先核对扩展要求的 PHP 版本,再检查构建和运行环境是否一致。换扩展版本后应确认实际服务成功加载,而不只看安装退出码。