ΠšΠΎΠΌΠΏΠΈΠ»ΡΡ†ΠΈΡ раздСляСмых ΠΌΠΎΠ΄ΡƒΠ»Π΅ΠΉ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ pecl

PECL ΡƒΠΏΡ€ΠΎΡ‰Π°Π΅Ρ‚ созданиС общСдоступных ΠΌΠΎΠ΄ΡƒΠ»Π΅ΠΉ 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 потрСбуСтся ΠΏΠ΅Ρ€Π΅Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚ΡŒ Π²Π΅Π±-сСрвСр, Ρ‡Ρ‚ΠΎΠ±Ρ‹ измСнСния вступили Π² силу.

οΌ‹Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΡ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ 7 notes

up
20
giulliano dot scatalon dot rossi at gmail dot com ΒΆ
6 years ago
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 someone
up
11
ezekial aikle ΒΆ
2 years ago
Options 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:397
up
9
Bichis Paul ΒΆ
9 years ago
on Mageia Linux use urpmi

[afk@mageia5][~]$ sudo urpmi php-pear
up
10
ktcox at mail dot com ΒΆ
15 years ago
The Arch Linux package that contains PECL is 'php-pear'

# pacman -S php-pear
up
8
ericn at amazon dot com ΒΆ
12 years ago
To 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_http
up
9
zir dot echo at gmail dot com ΒΆ
18 years ago
Install pecl for gentoo:

emerge dev-php/PEAR-PEAR
up
2
pedro dot fonini at gmail dot com ΒΆ
18 years ago
to use the pecl, pear, or phpize commands in fedora, install the php-devel package:
$ yum install php-devel