您好,登錄后才能下訂單哦!
這篇文章主要介紹“mac下pecl的擴(kuò)展如何配置”的相關(guān)知識,小編通過實(shí)際案例向大家展示操作過程,操作方法簡單快捷,實(shí)用性強(qiáng),希望這篇“mac下pecl的擴(kuò)展如何配置”文章能幫助大家解決問題。
mac 下 pecl 的 擴(kuò)展配置 ( 基于php7.4 )
環(huán)境確認(rèn)
如果你的php是通過brew安裝的,一般情況下是帶了pecl的。
$ pecl version
PEAR Version: 1.10.13
PHP Version: 7.4.28
Zend Engine Version: 3.4.0
如果沒有,可以通過以下腳本安裝。
安裝腳本
$ 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/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
到擴(kuò)展目錄看以下
/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
很明顯 安裝擴(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_dir
extension_dir => /opt/homebrew/lib/php/pecl/20190902
比如我安裝了一個 yaml.so
擴(kuò)展。
直接在 /opt/homebrew/etc/php/7.4/php.ini
中添加一行 yaml.so
,會自動在 /opt/homebrew/lib/php/pecl/20190902/yaml.so
找到軟連接到 /opt/homebrew/Cellar/php@7.4/7.4.28_1/pecl/20190902/yaml.so
的原始擴(kuò)展。
關(guān)于“mac下pecl的擴(kuò)展如何配置”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識,可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點(diǎn)。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。