在控制台中输入以下代码可实现Xdebug的开启和关闭:

开启:

document.cookie = "XDEBUG_SESSION=PHPSTORM; path=/";

关闭:

document.cookie = "XDEBUG_SESSION=; expires=" + (new Date()).toGMTString() + ";";