I have installed both php5.6 and php7.0 from PPA on Ubuntu according to this manual
But I didn't get how to install extensions using pecl
for php5.6 or php7.0.
I have installed it about a year ago on my AF61 Today. It is still in nice condition, rubber is soft and flexible, hasn't cracked yet. I use it very often and on quite bad roads, so it takes much abuse. Oleg Saxophone Key Enhancers improve the ergonomics and ease of playing for most professional vintage Selmer, King and Conn and contemporary saxophones. F-Fork Extension. Oleg Saxophone Enhancers improve the ergonomics and ease of playing for most vintage and contemporary saxophones. These jewelry-quality enhancers are easily clipped.
For example I have already installed version of libevent
or amqp
in php5.6.
Now when I type pecl install libevent
and my active php version is php7.0 (using update-alternatives --set php /usr/bin/php7.0),
peclreturns message that
libevent` already installed.
But it was installed only for php5.6 (when this version was active) and now I want to do it for php7.0.
Which commands could help me?
UPD
I have found this commands for switch pecl to php7.0 and packet them to executable bash scripts:
and for php5.6
But they are not help, pecl still gives me list
of already installed extensions to php5.6, even if I switched to php7.
It should be empty for php7.0 !
How to solve the problem?
UPD
For amqp I have just installed php-amqp package without using pecl.
And libevent still not exists for php7.But I hadn't found a way to switch pecl installation between 5.6 and 7 version, so question is still open.
Alex Grin3 Answers
Here's what worked best for me when trying to script this (in case anyone else comes across this like I did):
The -d php_suffix=<version>
piece allows you to set config values at run time vs pre-setting them with pecl config-set
. The uninstall -r
bit does not actually uninstall it (from the docs):
The uninstall line is necessary otherwise installing it will remove any previously installed version, even if it was for a different PHP version (ex: Installing an extension for PHP 7.0 would remove the 5.6 version if the package was still registered as installed).
I ran into this same issue while updating my Vagrant box with XHGui, as XHGui requires mongodb. I wanted to be able to support profiling on both PHP 5.6 and 7.0.
I dug into the pecl source code, and found that there's a metadata_dir
config option. That is a path to a directory where the current state of installed packages. Unfortunately, that isn't already namespaced per PHP version. If you try and set it with pecl config-set
, you get an opaque 'failed' error. It turns out that setting isn't whitelisted as being configuable in the PEAR_Config
class:
In PECL's world, 'global' means it can only be set at install time, and not after.
There's an issue in the PPA tracker over at github: https://github.com/oerdnj/deb.sury.org/issues/407
The final suggestion there is to build the extension manually for alternate PHP versions. I ended up using pecl for PHP 7 extensions, and manual builds for 5.6. Make sure you run update-alternatives
for php-config and phpize, and not just php before building:
Then, extract the extension and build it. These steps from the above issue worked for me with the mongodb extension:
phpize5.6 && ./configure --with-php-config=php-config5.6 && make && sudo make install
When pecl throws error is already installed and is the same as the released version
Switch to required php, php-config, phpize versions before installing from pecl
Just run it installation with force flag