pecl installs for previous php version

前端 未结 7 820
心在旅途
心在旅途 2021-01-30 14:40

I\'ve upgraded my MacBook to Mavericks and ruined my development environment. The problem I have right now is that my pear/pecl still tries to install for my previous (5.3) vers

7条回答
  •  甜味超标
    2021-01-30 15:17

    In my case, I was attempting to install Gearman.

    pecl install gearman would install it incorrectly.

    php -i would show:

    PHP Extension => 20100525
    

    Yet pecl would install using:

    PHP Api Version:         20090626
    

    After changing my config settings to use:

    First Fix

    sudo pecl config-set php_ini /etc/php.ini
    sudo pecl config-set php_bin /usr/bin/php5
    

    I noticed that I would still get

    WARNING: php_bin /usr/bin/php5 appears to have a suffix 5, but config variable php_suffix does not match

    You can resolve this by using the config setting:

    Additional Fix

    sudo pear config-set php_suffix 5
    

    Why was this a problem?

    For me, I got into this problem because I added a custom PPA and reinstalled PHP. This meant that my previous install of php5-dev was out of sync.

    You if you ever get into the same situation, you might just want to run..

    apt-get remove php5-dev
    pecl uninstall 
    apt-get install php5-dev
    apt-get remove php5-pear
    apt-get install php5-pear
    pecl install 
    

    Alternatively, you can download the source and run phpize.

提交回复
热议问题