How to install pecl extension in php

藏色散人
Release: 2023-03-03 08:46:01
Original
5436 people have browsed it

How to install pecl extension in php: First open the terminal command window; then enter and execute the command "sudo yum install php-dev php-pear autoconf, automake, libtool -y" to install pecl.

How to install pecl extension in php

Pecl's full name is The PHP Extension Community Library, a PHP community extension library, written and maintained by the community. The convenience of using pecl is that we don’t need to search for source code packages to download, compile and configure. We don’t need to manually phpize, configure, make, make install. The module installation path is automatically identified. We only need to edit the php.ini configuration file to enable the extension. Of course, we also need When configuring some parameters yourself, you can download the source code first and then build it

Recommended: "PHP Tutorial"

Install pecl

Apt

➜ sudo apt-get install php-dev php-pear autoconf,automake,libtool -y
Copy after login

Yum

➜ sudo yum install php-dev php-pear autoconf,automake,libtool -y
Copy after login

pecl common commands

build 从C的源码中构建扩展 install 安装一个包,步骤包含(configure,make,make install) download 下载源码包 list-all 列出全部包 run-tests 运行测试(make test)
Copy after login

pecl --help

Install MongoDB extension

➜ sudo pecl install mongodb
Copy after login

Configure PHP.ini

Redhat

extension=mongodb.so
Copy after login

Debian/Ubuntu

sudo vim /etc/php/7.0/mods-available/mongodb.ini
Copy after login
; configuration for php mongodb module ; priority=20 extension=mongodb.so
Copy after login

Zend extension

zend_extension=opcache.so
Copy after login
➜ sudo phpenmod mongodb
Copy after login

Confirm whether the installation is successful

➜ php -m | grep mongodb mongodb
Copy after login

The above is the detailed content of How to install pecl extension in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!