相信用java,或者nodejs的人,一定体会过用断点调试来查找程序错误的优点与方便。php也有断点调试功能,就是配置起来有一些麻烦。 准备工作:
[XDebug]xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"zend_extension="D:\phpStudy\php\php-5.4.45\ext\php_xdebug.dll" xdebug.remote_enable=ONxdebug.profiler_enable = Offxdebug.remote_handler = dbgpxdebug.remote_host = localhostxdebug.remote_mode = reqxdebug.remote_port = 9000xdebug.idekey=PHPSTORM
zend_extension=”D:\phpStudy\php\php-5.4.45\ext\php_xdebug.dll” 这里填写自己安装的路径,如果phpstudy安装的话,就不需要修改。 2. 安装xdebug helper
我用的google浏览器,其他的也可以,下载对应的xdebug helper 就可以了。 配置xdebug helper 拓展程序里或者右键那个小虫子选择选项 选择ide key phpstorm 其他的可以不用管
最后调试 右键行号空白处,然后浏览器访问,程序会停在断点那里