pecl installs for previous php version

前端 未结 7 734
心在旅途
心在旅途 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:21

    On Ubuntu 16.04, when using ppa:ondrej/php (and probably other alternatives), in order to install pecl/php extensions for php 5.6, you have to do the following:

    pecl config-set ext_dir /usr/lib/php/20131226
    pecl config-set php_bin /usr/bin/php5.6
    pecl config-set php_ini /etc/php/5.6/cli/php.ini
    pear config-set ext_dir /usr/lib/php/20131226
    pear config-set php_bin /usr/bin/php5.6
    pear config-set php_ini /etc/php/5.6/cli/php.ini
    update-alternatives --config php #select php 5.6
    update-alternatives --config php-config #select php 5.6
    update-alternatives --config phpize #select php 5.6
    

    Next you can use pecl as usual:

    pecl install raphf-1.1.2
    

    downloading raphf-1.1.2.tgz ... Starting to download raphf-1.1.2.tgz (15,915 bytes) ......done: 15,915 bytes 8 source files, building

    running: phpize

    Configuring for:

    PHP Api Version: 20131106

    Zend Module Api No: 20131226

    Zend Extension Api No: 220131226

    ...

    install ok: channel://pecl.php.net/raphf-1.1.2

    Extension raphf enabled in php.ini

    I noticed that, when no extension are enabled in php.ini, pecl add the line extension="xxx.so" at the beginning of the php.ini, so I usually move it at the end of the file, manually, and after it's ok for the next extensions.

    Depending of what you have on your system, it may be necessary to rollback your changes after install, especially for the default php version to use, with update-alternatives

提交回复
热议问题