Home >Backend Development >PHP Tutorial >what is pecl? How to install pecl under centos?

what is pecl? How to install pecl under centos?

WBOY
WBOYOriginal
2016-08-29 08:50:543188browse

I want to install the swoole extension in my system. The official website provides installation using pecl. However, after I entered pecl install swoole, the system said that the command was not found. Then I searched Baidu for a long time and could not find how to install pecl under linux. What is this thing? How to install it?

Reply content:

I want to install the swoole extension in my system. The official website provides installation using pecl. However, after I entered pecl install swoole, the system said that the command was not found. Then I searched Baidu for a long time and could not find how to install pecl under linux. What is this thing? How to install it?

PECL: PHP Extension Community Library

Official website: pecl.php.net

Generally, PHP is installed in its bin directory, such as /usr/local/php/bin

So if you want to use it directly, either add the bin directory to the environment variable PATH, or soft-link it to the /usr/bin directory

yum install php-devel

<code>#Ubuntu/Debian上是这样(php-pear包含pecl,php5-dev包含phpize,pecl依赖phpize)
apt-get install php-pear php5-dev
pecl install swoole

#CentOS/Redhat上应该是这样
yum install php-pear php-devel
pecl install swoole

#如果是自行编译的PHP(假设安装目录为/opt/php/7.0)
/opt/php/7.0/bin/phpize
/opt/php/7.0/bin/pecl</code>

Compile and install PHP tutorial reference on Linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn