This article mainly introduces on the Mac under the Brew installs PHP and the extension, has the certain reference value, now shares to everybody, has the need friend to refer to
Mac HomeBrew [2018-03-31] deprecated
homebrew/php
, PHP version renamed (such as: Php70 = php@7.0), can not be directly searched for each version of the corresponding extension directly installed such as:
brew install php70-redis
, can be installed with the
pecl
PHP corresponding expansion The exhibition, taking
php@7.0
as an example
Remove the original homebrew/php tap
$ Brew Untap Homebrew/tap
Installing php@7.0
$ Brew Install php@7.0
PECL Installing extensions
Installation
# view pecl$ pecl versionpear version:1.10.5php version:7.0.30zend Engine version:3.0.0running on:darwin Mac 17.5.0 Darwi n Kernel Version 17.5.0:mon Mar 5 22:24:32 PST 2018 root:xnu-4570.51.1~1/release_x86_64 x86_64# install xdebug extension $ pecl ins Tall Xdebug ... Build process completed successfullyinstalling '/usr/local/cellar/php@7.0/7.0.30/pecl/20151012/xdebug.so ' install OK : Channel://pecl.php.net/xdebug-2.6.0extension Xdebug Enabled in php.ini
xdebug.so Migration
# xdebug.so compiled into the/usr/local/cellar/php@7.0/7.0.30/pecl/20151012/directory $ cd/usr/local/cellar/php@7.0/7.0.30 && Lltotal 256...lrwxr-xr-x 1 username admin 23B 5 7 19:53 pecl-/usr/local/lib/php/pecl...# '/ Usr/local/cellar/php@7.0/7.0.30/pecl ' directory is actually soft-chained to '/usr/local/lib/php/pecl ' directory # move xdebug.so to php@7.0 default extension directory # php@7.0 default extension directory is '/usr/local/cellar/php@7.0/7.0.30/lib/php/20151012/', you can get $ cp/usr/local/cellar/php@7.0/by Phpinfo () 7.0.30/pecl/20151012/xdebug.so/usr/local/cellar/php@7.0/7.0.30/lib/php/20151012/
Modify Configuration
# view PHP.ini directory $ php--ini .... Loaded Configuration File: /usr/local/etc/php/7.0/php.iniscan for additional. ini files in:/usr/local/etc/php/7.0 /conf.d....# Edit php.ini$ vim/usr/local/etc/php/7.0/php.ini# Delete First line: zend_extension= "xdebug.so" # in '/usr/local/etc /PHP/7.0/CONF.D ' directory added xdebug.ini$ vim/usr/local/etc/php/7.0/conf.d/xdebug.ini# add the following [xdebug]zend_extension=] Xdebug.so "
View Extensions
$ php-m[php Modules] ... [Zend Modules] Xdebug <== successfully installed Zend Opcache
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!