PhpStrom xdebug
简介
Xdebug是一个开放源代码的PHP程序调试器(即一个Debug工具),可以用来跟踪,调试和分析PHP程序的运行状况。Xdebug现在的最新版本是Xdebug 2.4.0RC4,release日期 2016-01-25,添加了对PHP7的支持。(摘自百度百科)
Zero-configuration Web Application Debugging with Xdebug and PhpStorm
服务器安装(CENTOS7)
wget https://xdebug.org/files/xdebug-2.5.1.tgz -P /usr/local/src/
tar -zxvf xdebug-2.5.1.tgz
cd xdebug-2.5.1
/usr/local/php/bin/phpize
./configure –with-php-config=/usr/local/php/bin/php-config
make && make install
cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/
vim /usr/local/php/etc/php.ini
[XDEBUG]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_host = 192.168.31.206 //对应PHPSTROM 客户端IP
xdebug.remote_port = 9000 //对应PHPSTROM Debug port
xdebug.idekey = PHPSTORM //对应PHPSTROM IDE key
systemctl restart php-fpm
客户端安装
PHPSTROM设置
File -> Settings -> Languages & Frameworks -> PHP -> Debug
File -> Settings -> Languages & Frameworks -> PHP -> Debug -> DBGp Proxy
IDE key //对应服务器xdebug.idekey
Host //对应服务器IP
Port //对应服务器端口
Run/Debug Configurations -> add PHP Web Application
Server settings
Name //任意
Host //对应服务器IP
Port //对应服务器端口
Absolute path on the server //对应服务器相应的目录
chrome浏览器设置
https://chrome.google.com/webstore/category/extensions?hl=zh-CN
JetBrains IDE Support
问题
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
# yum install m4
# yum install autoconf