rogeecn
V2EX  ›  PHP

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

  •  
  •   rogeecn · Oct 19, 2014 · 9437 views
    This topic created in 4397 days ago, the information mentioned may be changed or developed.
    ➜ 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 replies  •  2014-10-28 12:55:31 +08:00
    rogeecn
    rogeecn
    OP
    Oct 19, 2014
    1
    问题应该是因为phpize 的版本不一至造成的,怎么升级呢??、
    wuhang89
    wuhang89
    Oct 19, 2014
    2
    额,这个很好解决吧,你肯定是存在多个版本的php,然后用其他的版本的phpize编译的。
    jk2r
    jk2r
    Oct 19, 2014
    3
    重新编译安装就行了
    cd path-to-phpredis-source/
    phpize
    make && make install

    然后php -m 看一下,模块加载上没
    nevernet
    nevernet
    Oct 19, 2014
    4
    我是通过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
    Yuansir
    Oct 20, 2014
    5
    @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
    beaaar
    Oct 25, 2014
    6
    我也是刚升级10.10。我在挂载mcrypt的时候也遇到了同样的问题,不知为什么phpize所调用的api version和php本身编译的api version不同。楼主解决了么?
    beaaar
    beaaar
    Oct 25, 2014
    7
    难道是升级后存在两个版本的php?但是搜索后没发现啊
    nevernet
    nevernet
    Oct 27, 2014
    9
    @beaaar 可以which phpize 看看具体调用的是哪个phpize, 注意统一即可。
    tinyhill
    tinyhill
    Oct 28, 2014
    10
    装 mcrypt 组件的时候遇到同样问题,可以看看我的记录,不知能否解决楼主的问题:
    http://mangguo.org/mac-os-x-yosemite-install-php-mcrypt-extension/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5312 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 01:27 · PVG 09:27 · LAX 17:27 · JFK 20:27
    ♥ Do have faith in what you're doing.