MAC 升级了,状 phpRedis 模块遇到问题。

2014-10-19 15:18:54 +08:00
 rogeecn
➜ phpredis git:(master) ✗ php -v
PHP Warning: PHP Startup: redis: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
PHP 5.5.14 (cli) (built: Sep 9 2014 19:09:25)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

=========分割线================
上面是遇见的问题,phpredis的包是直接checkout主干代码。
➜ phpredis git:(master) ✗ phpize -v
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525

这个是phpize的版本信息。
有遇见的解决了的小伙伴没?
在线等~
7942 次点击
所在节点    PHP
10 条回复
rogeecn
2014-10-19 15:46:54 +08:00
问题应该是因为phpize 的版本不一至造成的,怎么升级呢??、
wuhang89
2014-10-19 15:59:58 +08:00
额,这个很好解决吧,你肯定是存在多个版本的php,然后用其他的版本的phpize编译的。
jk2r
2014-10-19 16:11:03 +08:00
重新编译安装就行了
cd path-to-phpredis-source/
phpize
make && make install

然后php -m 看一下,模块加载上没
nevernet
2014-10-19 18:52:27 +08:00
我是通过brew 重新安装了php, 不再使用默认的php, 更容易控制PHP的版本。

https://github.com/Homebrew/homebrew-php

installation
====================

Setup the homebrew/dupes tap which has dependencies we need:

brew tap homebrew/dupes
Setup the homebrew/versions tap which has dependencies we need:

brew tap homebrew/versions
Then, run the following in your command-line:

brew tap homebrew/homebrew-php
Yuansir
2014-10-20 09:02:22 +08:00
@nevernet 我用brew安装php的时候一直装不了icu4c,你遇到这样的问题了吗

==> Installing php54 dependency: icu4c
==> Downloading http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.tgz
Already downloaded: /Library/Caches/Homebrew/icu4c-54.1.tgz
==> ./configure --prefix=/usr/local/Cellar/icu4c/54.1 --disable-samples --disable-tests --enable-static --with-library-bits=64
==> make
icu_54::CalendarAstronomer::getMoonPosition() in astro.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../lib/libicui18n.54.1.dylib] Error 1
make: *** [all-recursive] Error 2

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
beaaar
2014-10-25 00:03:45 +08:00
我也是刚升级10.10。我在挂载mcrypt的时候也遇到了同样的问题,不知为什么phpize所调用的api version和php本身编译的api version不同。楼主解决了么?
beaaar
2014-10-25 00:04:40 +08:00
难道是升级后存在两个版本的php?但是搜索后没发现啊
nevernet
2014-10-27 13:29:36 +08:00
nevernet
2014-10-27 13:30:26 +08:00
@beaaar 可以which phpize 看看具体调用的是哪个phpize, 注意统一即可。
tinyhill
2014-10-28 12:55:31 +08:00
装 mcrypt 组件的时候遇到同样问题,可以看看我的记录,不知能否解决楼主的问题:
http://mangguo.org/mac-os-x-yosemite-install-php-mcrypt-extension/

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/140002

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX