XDebug does not break on breakpoints from atom's php-debug package

杀马特。学长 韩版系。学妹 提交于 2019-12-05 02:25:28

I've uploaded your PHP info output here - https://xdebug.org/wizard.php. And among others I've got next message: "You seem to have Xdebug loaded as a normal PHP extension only. This will cause odd issues, please see https://xdebug.org/docs/faq#php-ext"

Q: Xdebug is only loaded as PHP extension and not as a Zend Extension.

In order for Xdebug to work properly, including breakpoints etc. it is required that it is loaded as a Zend extension, and not just as a normal PHP extension. Some installation tools (PEAR/PECL) sometimes advice you to use extension=xdebug.so to load Xdebug. This is not correct. In order to fix this issue, please look for a line extension=xdebug.so in any of the INI files that are listed under "Loaded Configuration File" and "Additional .ini files parsed" in the top block. Remove this line, and go back to the Tailored Installation Instructions.

So here is the instructions for your case:

  1. Download php_xdebug-2.4.1-7.0-vc14.dll
  2. Move the downloaded file to C:\MAMP\bin\php\php7.0.9\ext
  3. Edit C:\MAMP\conf\php7.0.9\php.ini and add the line zend_extension = C:\MAMP\bin\php\php7.0.9\ext\php_xdebug-2.4.1-7.0-vc14.dll
  4. Restart the webserver

Also you may take a look at special kind of "debug" functions, which came with xdebug extension - https://xdebug.org/docs/all_functions

For example you can use xdebug_break(). It allows you to specify breakpoints without using IDE.


And one note regarding Atom setup. On this page https://atom.io/packages/php-debug you may find explanation of the configuration process. I'd like to put your attention on config.cson file. Check out my config snippet below. Do you have something similar in your project?

"php-debug": 
{
    ServerPort: 9000
    PathMaps: [
        "remotepath;localpath"      
    ]
}

Just a shot in the dark, but have you tried to set a breakpoint at the very entry point of your framework ?

I had a similar issue with another framework and your problem may just be that xdebug can't do the mapping with the local files, and setting a breakpoint on the very first executed line may solve that.

For example, PhpStorm has an debug option called "Break at the first line" which solved the issue for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!