V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
rogeecn
V2EX  ›  PHP

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

  •  
  •   rogeecn · 2014-10-19 15:18:54 +08:00 · 7930 次点击
    这是一个创建于 3467 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ➜ 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的版本信息。
    有遇见的解决了的小伙伴没?
    在线等~
    10 条回复    2014-10-28 12:55:31 +08:00
    rogeecn
        1
    rogeecn  
    OP
       2014-10-19 15:46:54 +08:00
    问题应该是因为phpize 的版本不一至造成的,怎么升级呢??、
    wuhang89
        2
    wuhang89  
       2014-10-19 15:59:58 +08:00
    额,这个很好解决吧,你肯定是存在多个版本的php,然后用其他的版本的phpize编译的。
    jk2r
        3
    jk2r  
       2014-10-19 16:11:03 +08:00
    重新编译安装就行了
    cd path-to-phpredis-source/
    phpize
    make && make install

    然后php -m 看一下,模块加载上没
    nevernet
        4
    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
        5
    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
        6
    beaaar  
       2014-10-25 00:03:45 +08:00
    我也是刚升级10.10。我在挂载mcrypt的时候也遇到了同样的问题,不知为什么phpize所调用的api version和php本身编译的api version不同。楼主解决了么?
    beaaar
        7
    beaaar  
       2014-10-25 00:04:40 +08:00
    难道是升级后存在两个版本的php?但是搜索后没发现啊
    nevernet
        9
    nevernet  
       2014-10-27 13:30:26 +08:00
    @beaaar 可以which phpize 看看具体调用的是哪个phpize, 注意统一即可。
    tinyhill
        10
    tinyhill  
       2014-10-28 12:55:31 +08:00
    装 mcrypt 组件的时候遇到同样问题,可以看看我的记录,不知能否解决楼主的问题:
    http://mangguo.org/mac-os-x-yosemite-install-php-mcrypt-extension/
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3309 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 14:07 · PVG 22:07 · LAX 07:07 · JFK 10:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.