任何疑问请加QQ:79811993
Install PEAR
=========================
1. 下载pear
curl -O http://pear.php.net/go-pear.phar
2. 安装pear
sudo php -d detect_unicode=0 go-pear.phar
3. 执行以上命令后会进行安装过程,会有一些配置选项
输入1,回车,配置pear路径为:/usr/local/pear
输入4,回车,配置命令路径为:/usr/local/bin
4.回车两次,其他让其默认,安装完成
5. 可以通过命令检查pear安装是否成功`pear version`
Install XDebug
=========================
sudo pecl install xdebug
- if need
brew uninstall php70/php71…
brew install php@7.2
http://xdebug.org/install.php#configure-php
Build process completed successfully
Installing '/usr/local/Cellar/php/7.2.6/pecl/20170718/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.6.0
Extension xdebug enabled in php.ini
通过phpinfo查看结果:
Config Xdebug
=========================
vi /usr/local/etc/php/7.2/conf.d/ext-xdebug.ini
[xdebug]
zend_extension="/usr/local/Cellar/php/7.2.6/pecl/20170718/xdebug.so"
xdebug.auto_trace = On
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
View Result using Webgrind
=========================
https://github.com/jokkedk/webgrind
- Download webgrind
- Unzip package to favourite path accessible by webserver.
- Load webgrind in browser and start profiling
http://localhost/PHPTools/webgrind-1.5.0/
see callInfo
=========================
need dot(contain in graphviz) and python
brew install graphviz
brew install python