人妻精品在线观看一区二区三区,蜜臀av精品一区二区三区网站,中文一区二区三区亚洲欧美,熟女人妇精品一区二区,人妻av在线观看视频,欧美日韩国产三级精品网站,黄色免费网站直接进入,超碰公开福利正在播放,国产毛片乡下农村妇女毛片

詳解mac下pecl的擴(kuò)展配置(附代碼實(shí)例)-全球熱資訊

來(lái)源:php中文網(wǎng) | 2023-03-25 17:48:35 |

本篇文章給大家?guī)?lái)了關(guān)于PHP的相關(guān)知識(shí),其中主要跟大家介紹有關(guān)mac下pecl的擴(kuò)展配置,本文是基于php7.4的,感興趣的朋友下面一起來(lái)看一下吧,希望對(duì)大家有幫助。


(相關(guān)資料圖)

mac 下 pecl 的 擴(kuò)展配置 ( 基于php7.4 )

環(huán)境確認(rèn)

如果你的php是通過(guò)brew安裝的,一般情況下是帶了pecl的。

$ pecl versionPEAR Version: 1.10.13PHP Version: 7.4.28Zend Engine Version: 3.4.0

如果沒(méi)有,可以通過(guò)以下腳本安裝。

安裝腳本

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

pecl配置

查看pecl的相關(guān)配置

$ pecl config-show

這里可以看到pecl的默認(rèn)擴(kuò)展目錄

PEAR executables directory     bin_dir          /opt/homebrew/lib/php/pecl/binPEAR documentation directory   doc_dir          /opt/homebrew/share/pear@7.4/docPHP 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/cachePEAR configuration file        cfg_dir          /opt/homebrew/lib/php/pecl/cfg

到擴(kuò)展目錄看以下

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

很明顯 安裝擴(kuò)展.so文件的目錄是 /opt/homebrew/Cellar/php@7.4/7.4.28_1/pecl,此目錄實(shí)際上是軟鏈接到了 /opt/homebrew/lib/php/pecl

目錄配置

查看php的擴(kuò)展目錄

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

比如我安裝了一個(gè) yaml.so擴(kuò)展。直接在 /opt/homebrew/etc/php/7.4/php.ini中添加一行 yaml.so,會(huì)自動(dòng)在 /opt/homebrew/lib/php/pecl/20190902/yaml.so找到軟連接到 /opt/homebrew/Cellar/php@7.4/7.4.28_1/pecl/20190902/yaml.so的原始擴(kuò)展。

推薦學(xué)習(xí):《PHP視頻教程》

以上就是詳解mac下pecl的擴(kuò)展配置(附代碼實(shí)例)的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!

關(guān)鍵詞: