您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關如何在mac pecl中安裝php7.1擴展,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
brew search php
==> Searching local taps... php@5.6 ? php@7.1 ? brew-php-switcher php php-code-sniffer php-cs-fixer php@7.0 phplint phpunit ==> Searching taps on GitHub... homebrew/cask/eclipse-php homebrew/cask/netbeans-php ==> Searching blacklisted, migrated and deleted formulae...
brew install php@7.1
php -v
PHP 7.1.18 (cli) (built: May 25 2018 19:18:42) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.18, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
pecl安裝
curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar 一路回車到最后,然后 pecl version
pecl 安裝擴展
pecl search mongodb 前面直接安裝就行,然后我下面展示最后顯示的內容
Build process completed successfully Installing '/usr/local/Cellar/php@7.1/7.1.18/pecl/20160303/mongodb.so' install ok: channel://pecl.php.net/mongodb-1.4.4 Extension mongodb enabled in php.ini
這個時候我的php.ini 是軟連接到的etc下面,然后上面安裝的擴展會自動安裝到php.ini中,然后我們把里面加載的刪除掉
# xdebug.so編譯到了 /usr/local/Cellar/php@7.1/7.1.18/lib/php/20160303/ 目錄下 $ cd /usr/local/Cellar/php@7.1/7.1.18/ && ll # 將mongodb.so移動到php@7.1默認擴展目錄 cp /usr/local/Cellar/php@7.1/7.1.18/pecl/20160303/mongodb.so /usr/local/Cellar/php@7.1/7.1.18/lib/php/20160303
php –ini 查看
Configuration File (php.ini) Path: /usr/local/etc/php/7.1 Loaded Configuration File: /usr/local/etc/php/7.1/php.ini Scan for additional .ini files in: /usr/local/etc/php/7.1/conf.d Additional .ini files parsed: /usr/local/etc/php/7.1/conf.d/ext-opcache.ini, /usr/local/etc/php/7.1/conf.d/mongodb.ini, /usr/local/etc/php/7.1/conf.d/redis.ini, /usr/local/etc/php/7.1/conf.d/xdebug.ini
修改php.ini的配置
刪除上面加入的
extension="mongodb.so" # 在`/usr/local/etc/php/7.1/conf.d`目錄下新增mongodb.ini $ vim /usr/local/etc/php/7.1/conf.d/mongodb.ini # 加入以下內容 [mongodb] extension="mongodb.so"
查看擴展
php -m
以上就是如何在mac pecl中安裝php7.1擴展,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。