Skip to content
Advertisement

How do I ignore certain files while debugging in PHPStorm?

I have debugging working in PHPStorm with Xdebug and my local apache webserver. I’m also using CodeSniffer to check my code style. CodeSniffer (phpcs.bat) is a tool you can enable in PHPstorm that is actually an external PHP script that runs every 3-5 seconds. The annoying thing is, whenever I have debug enabled (Listen for connections), it tries to debug the phpcs script even though it is not a part of my project. What’s even odder is that phpcs is run via the php command line, NOT the apache server of which Xdebug is a part.

Is there anyway to stop phpStorm from debugging this external, command-line script?

Advertisement

Answer

One possible solution is to add the following parameters to the bat file that runs phpcs:

-d xdebug.remote_host="8.8.1.1" 
-d xdebug.remote_enable=0 
-d xdebug.remote_autostart=0

This sets custom PHP ini settings on the command line interface.


Alternately, go to Settings | PHP | Debug in PHPStorm and add a directory to the debug ignore list.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement