search
HomeBackend DevelopmentPHP7Detailed explanation of the extended configuration of pecl under mac (with code examples)

This article brings you relevant knowledge about PHP. It mainly introduces to you the extended configuration of pecl under mac. This article is based on php7.4. Interested friends can take a look at it together. I hope Helpful to everyone.

Detailed explanation of the extended configuration of pecl under mac (with code examples)

Extended configuration of pecl under mac (based on php7.4)

Environment confirmation

If your php is installed through brew, pecl is usually included.

$ pecl version
PEAR Version: 1.10.13
PHP Version: 7.4.28
Zend Engine Version: 3.4.0

If not, you can install it through the following script.

Installation script

$ curl -O https://pear.php.net/go-pear.phar
$ sudo php -d detect_unicode=0 go-pear.phar

pecl configuration

View pecl related configuration

$ pecl config-show

You can see it here Go to the default extension directory of pecl

PEAR executables directory     bin_dir          /opt/homebrew/lib/php/pecl/bin
PEAR documentation directory   doc_dir          /opt/homebrew/share/pear@7.4/doc
PHP extension directory        ext_dir          /opt/homebrew/Cellar/php@7.4/7.4.28_1/lib/php/20190902PEAR directory                 php_dir          /opt/homebrew/share/pear@7.4PEAR Installer cache directory cache_dir        /private/tmp/pear/cache
PEAR configuration file        cfg_dir          /opt/homebrew/lib/php/pecl/cfg

Go to the extension directory and see the following

/opt/homebrew/Cellar/php@7.4/7.4.28_1/ [master*] ls -all | grep pecl
lrwxr-xr-x   1 yuan  admin      26  3 30 20:21 pecl -> /opt/homebrew/lib/php/pecl

It is obvious that the directory where the extension .so file is installed is/opt/homebrew/Cellar/php@7.4/7.4 .28_1/pecl, this directory is actually a soft link to /opt/homebrew/lib/php/pecl.

Directory configuration

View the php extension directory

$ php -i | grep extension_dir
extension_dir => /opt/homebrew/lib/php/pecl/20190902

For example, I installed a yaml.so extension.
Add a line yaml.so directly to /opt/homebrew/etc/php/7.4/php.ini, it will automatically be added to
/opt/ homebrew/lib/php/pecl/20190902/yaml.so Find the original soft connection to /opt/homebrew/Cellar/php@7.4/7.4.28_1/pecl/20190902/yaml.so Extension.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of Detailed explanation of the extended configuration of pecl under mac (with code examples). For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:segmentfault. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use