mac os 安装memcache 出现 PHP Warning: PHP Startup: memcache: Unable to initialize module 解决办法

在Mac OS上安装memcache扩展时,由于存在两个PHP版本导致出现'PHP Startup: memcache: Unable to initialize module'警告。错误信息显示模块编译的API与PHP编译的API不匹配。解决此问题的方法是重新编译安装memcache,并在编译过程中添加'--with-php-config'选项以确保与PHP配置匹配。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于mac 上安装了2个php  所以导致memcache 安装扩展时候产生了如下错误

[27-May-2015 16:09:54] NOTICE: PHP message: PHP Warning:  PHP Startup: memcache: Unable to initialize module

Module compiled with module API=20090626

PHP    compiled with module API=20121212

These options need to match

 in Unknown on line 0

解决办法

重新编译安装 并加上  --with-php-config

/usr/local/php/bin/phpize #写全phpize的路径
./configure --with-php-config=/usr/local/php/bin/php-config  #配置时 要将php-config的路径附上
make && make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值