vi ~/.profile 在文件中增長如下一行 export PATH=/usr/local/php5/bin:/usr/local/php5/sbin:$PATH 執行下面的命令使改動當即生效 source ~/.profile
PHP 7.1.13 (cli) (built: Feb 1 2018 13:38:42) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.13, Copyright (c) 1999-2017, by Zend Technologies with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
PHP 7.1.13 (fpm-fcgi) (built: Feb 1 2018 13:38:47) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.13, Copyright (c) 1999-2017, by Zend Technologies with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
-rw-r--r-- 1 root wheel 75 2 1 20:41 10-extension_dir.ini -rw-r--r-- 1 root wheel 53 2 1 20:41 20-extension-opcache.ini -rw-r--r-- 1 root wheel 41 2 1 20:41 40-curl.ini -rw-r--r-- 1 root wheel 44 2 1 20:41 40-openssl.ini -rw-r--r-- 1 root wheel 103 2 1 20:41 50-extension-apcu.ini -rw-r--r-- 1 root wheel 18 2 1 20:41 50-extension-curl.ini -rw-r--r-- 1 root wheel 17 2 1 20:41 50-extension-gmp.ini -rw-r--r-- 1 root wheel 83 2 1 20:41 50-extension-igbinary.ini -rw-r--r-- 1 root wheel 18 2 1 20:41 50-extension-imap.ini -rw-r--r-- 1 root wheel 79 2 1 20:41 50-extension-intl.ini -rw-r--r-- 1 root wheel 20 2 1 20:41 50-extension-mcrypt.ini -rw-r--r-- 1 root wheel 84 2 1 20:41 50-extension-memcached.ini -rw-r--r-- 1 root wheel 82 2 1 20:41 50-extension-mongodb.ini -rw-r--r-- 1 root wheel 22 2 1 20:41 50-extension-mssql.ini -rw-r--r-- 1 root wheel 23 2 1 20:41 50-extension-pdo_pgsql.ini -rw-r--r-- 1 root wheel 19 2 1 20:41 50-extension-pgsql.ini -rw-r--r-- 1 root wheel 81 2 1 20:41 50-extension-propro.ini -rw-r--r-- 1 root wheel 80 2 1 20:41 50-extension-raphf.ini -rw-r--r-- 1 root wheel 22 2 1 20:41 50-extension-readline.ini -rw-r--r-- 1 root wheel 80 2 1 20:41 50-extension-redis.ini -rw-r--r-- 1 root wheel 79 2 1 20:41 50-extension-solr.ini -rw-r--r-- 1 root wheel 79 2 1 20:41 50-extension-ssh2.ini -rw-r--r-- 1 root wheel 427 5 8 17:20 50-extension-xdebug.ini -rw-r--r-- 1 root wheel 17 2 1 20:41 50-extension-xsl.ini -rw-r--r-- 1 root wheel 79 2 1 20:41 60-extension-pecl_http.ini -rw-r--r-- 1 root wheel 2004 2 1 20:41 99-liip-developer.ini
-rwxr-xr-x 1 root wheel 71936 2 1 20:41 apcu.so -rwxr-xr-x 1 root wheel 78668 2 1 20:41 curl.so -rwxr-xr-x 1 root wheel 44108 2 1 20:41 gmp.so -rwxr-xr-x 1 root wheel 350380 2 1 20:41 http.so -rwxr-xr-x 1 root wheel 42828 2 1 20:41 igbinary.so -rwxr-xr-x 1 root wheel 3188820 2 1 20:41 imap.so -rwxr-xr-x 1 root wheel 510600 2 1 20:41 intl.so -rwxr-xr-x 1 root wheel 38652 2 1 20:41 mcrypt.so -rwxr-xr-x 1 root wheel 84892 2 1 20:41 memcached.so -rwxr-xr-x 1 root wheel 2807892 2 1 20:41 mongodb.so -rwxr-xr-x 1 root wheel 322864 2 1 20:41 opcache.so -rwxr-xr-x 1 root wheel 38228 2 1 20:41 pdo_pgsql.so -rwxr-xr-x 1 root wheel 108104 2 1 20:41 pgsql.so -rwxr-xr-x 1 root wheel 16540 2 1 20:41 propro.so -rwxr-xr-x 1 root wheel 18064 2 1 20:41 raphf.so -rwxr-xr-x 1 root wheel 28824 2 1 20:41 readline.so -rwxr-xr-x 1 root wheel 331964 2 1 20:41 redis.so -rwxr-xr-x 1 root wheel 232832 2 1 20:41 solr.so -rwxr-xr-x 1 root wheel 63252 2 1 20:41 ssh2.so -rwxr-xr-x 1 root wheel 213268 2 1 20:41 xdebug.so -rwxr-xr-x 1 root wheel 30160 2 1 20:41 xsl.so
mysql和mongodb均可以使用brew來安裝。php
[xdebug] zend_extension =/usr/local/php5/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so xdebug.remote_enable = On xdebug.remote_handler = "dbgp" xdebug.remote_host = "localhost" xdebug.remote_port = 9001 xdebug.idekey = PHPSTROM
root 29992 0.0 0.0 4394508 680 ?? Ss 5:20下午 0:00.61 /usr/local/php5/sbin/php-fpm clive 32520 0.0 0.0 4286184 900 s002 S+ 7:57下午 0:00.00 grep php-fpm nobody 31455 0.0 0.0 4402220 3408 ?? S 6:43下午 0:00.55 /usr/local/php5/sbin/php-fpm nobody 31431 0.0 0.0 4408428 3468 ?? S 6:43下午 0:02.31 /usr/local/php5/sbin/php-fpm nobody 31428 0.0 0.0 4408428 3428 ?? S 6:43下午 0:02.43 /usr/local/php5/sbin/php-fpm