#xdebug安装 下载xdebug 打开终端 cd xdebug-2.4.x 切换到你解压出来的目录中 执行 phpize: phpize ./configure --enable-xdebug 执行编译命令 make 拷贝扩展到你想要的目录中 cp modules/xdebug.so /放置扩展的路径/xdebug.so 在 php.ini 中添加下列文件使xdebug扩展生效(Mac OS X下web开发常用文件所在目录) zend_extension="/放置扩展的路径/xdebug.so" mac下配置在/usr/local/etc/php下面 模块加载,在conf.d文件夹下面, 有ext-xdebug.ini别跟上层目录的php.ini重复了..者目录都是加载的 xdebug默认远程调试是关闭的,加上这个打开,要不没法调试 [xdebug]xdebug.remote_enable=On 重启apache(Mac OS X下重启apache) 贴一下我的配置: [xdebug] xdebug.remote_enable =1 xdebug.remote_handler = "dbgp" xdebug.remote_host = "localhost" xdebug.remote_mode = "req" xdebug.remote_port = 9001 xdebug.idekey=PHPSTORM ;xdebug.remote_autostart = On xdebug.remote_connect_back = On zend_extension="/usr/local/opt/php56-xdebug/xdebug.so" mac 折腾 php nginx apache 还有各种php扩展是很蛋疼的事各种编译弄这弄那... #建议 我现在用MAMP ,可以选择php版本,nginx还有laravel推荐的homestead mac下的vlet ; 不过我还是用的MAMP..