Mac+PhpStorm+Xdebug配置

一、下载对应Xdebug版本php

查看php版本【php7.1】:nginx

php -v

搜索对应xdebug版本:apache

brew search xdebug
    homebrew/php/php53-xdebug                homebrew/php/php70-xdebug
    homebrew/php/php54-xdebug                homebrew/php/php71-xdebug 
    homebrew/php/php55-xdebug                homebrew/php/xdebug-osx
    homebrew/php/php56-xdebug

下载对应版本xdebug:php7

brew install homebrew/php/php71-xdebug

二、修改php.ini配置文件phpstorm

找到php.ini文件,添加xdebug相关配置:ide

[xdebug]
zend_extension = "/usr/local/Cellar/php71-xdebug/2.5.1/xdebug.so"#填写本身的.so文件目录
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9001#端口号能够修改,避免冲突
xdebug.idekey = PHPSTROM

重启php-fpmphp-fpm

三、配置phpstorm
按照六个截图配置便可
一、
clipboard.png
二、
clipboard.png
三、
clipboard.png
四、
clipboard.png
五、
clipboard.png
六、
clipboard.png
配置完毕,重启apache或者nginx
点击小虫子,即刻开启debug之旅吧!
clipboard.pngspa

clipboard.png

相关文章
相关标签/搜索