To install the PECL on debian based linux distros (ubuntu, mint, kali, etc.)
Use the apitude command:
sudo apt-get install php-pear
I hope helped someonePECL ΡΠΏΡΠΎΡΠ°Π΅Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΠ΅ ΠΎΠ±ΡΠ΅Π΄ΠΎΡΡΡΠΏΠ½ΡΡ ΠΌΠΎΠ΄ΡΠ»Π΅ΠΉ PHP. ΠΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ ΡΠ»Π΅Π΄ΡΡΡΡΡ Β»Β ΠΊΠΎΠΌΠ°Π½Π΄Ρ pecl:
$ pecl install extname
ΠΠΎΠΌΠ°Π½Π΄Π° ΡΠΊΠ°ΡΠ°Π΅Ρ ΠΈΡΡ ΠΎΠ΄Π½ΡΠΉ ΠΊΠΎΠ΄ ΠΌΠΎΠ΄ΡΠ»Ρ extname, ΡΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡΡΠ΅Ρ ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡ ΡΠ°ΠΉΠ» extname.so Π² Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΡ extension_dir. ΠΠΎΡΠ»Π΅ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΡΠ°ΠΉΠ» extname.so ΠΏΠΎΠ»ΡΡΠΈΡΡΡ Π·Π°Π³ΡΡΠ·ΠΈΡΡ ΡΠ΅ΡΠ΅Π· ΡΠ°ΠΉΠ» php.ini
ΠΠΎΠΌΠ°Π½Π΄Π° pecl ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ Π½Π΅ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅Ρ
ΠΏΠ°ΠΊΠ΅ΡΡ Ρ ΠΎΡΠΌΠ΅ΡΠΊΠΎΠΉ alpha- ΠΈΠ»ΠΈ beta-Π²Π΅ΡΡΠΈΠΈ.
beta-Π²Π΅ΡΡΠΈΡ ΠΏΠ°ΠΊΠ΅ΡΠ° ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ ΡΠ»Π΅Π΄ΡΡΡΠ΅ΠΉ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ,
Π΅ΡΠ»ΠΈ stable-Π²Π΅ΡΡΠΈΠΈ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² Π½Π΅Π΄ΠΎΡΡΡΠΏΠ½Ρ:
$ pecl install extname-beta
Π‘Π»Π΅Π΄ΡΡΡΠ°Ρ ΠΊΠΎΠΌΠ°Π½Π΄Π° ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΡΡ Π²Π΅ΡΡΠΈΡ:
$ pecl install extname-0.1
ΠΠ°ΠΌΠ΅ΡΠ°Π½ΠΈΠ΅:
ΠΠΎΡΠ»Π΅ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ΅Π½ΠΈΡ ΠΌΠΎΠ΄ΡΠ»Ρ Π² ΡΠ°ΠΉΠ»Π΅ php.ini ΠΏΠΎΡΡΠ΅Π±ΡΠ΅ΡΡΡ ΠΏΠ΅ΡΠ΅Π·Π°ΠΏΡΡΡΠΈΡΡ Π²Π΅Π±-ΡΠ΅ΡΠ²Π΅Ρ, ΡΡΠΎΠ±Ρ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ Π²ΡΡΡΠΏΠΈΠ»ΠΈ Π² ΡΠΈΠ»Ρ.
To install the PECL on debian based linux distros (ubuntu, mint, kali, etc.)
Use the apitude command:
sudo apt-get install php-pear
I hope helped someoneOptions to pass to configure (with -D or --configureoptions=) need to be specified this way in a Dockerfile RUN command:
RUN pecl install -D 'with-example-dir="/dir" enable-example-thing="yes"' package
or
RUN pecl install --configureoptions='with-example-dir="/dir" enable-example-thing="yes"' package
Otherwise, docker build might quote the command in a way that pecl doesn't parse correctly, and the build will fail with an error like this one:
PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /usr/local/lib/php/PEAR/Builder.php:397The Arch Linux package that contains PECL is 'php-pear'
# pacman -S php-pearTo compile pecl extensions on Amazon Linux AMIs, follow the tutorial at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html and then install these additional required packages with the following command:
[ec2-user ~]$ sudo yum install php-devel zlib-devel curl-devel gcc
You should then be able to compile pecl extensions; for example, enter the following command to compile the pecl_http extension:
[ec2-user ~]$ sudo pecl install pecl_httpto use the pecl, pear, or phpize commands in fedora, install the php-devel package:
$ yum install php-devel