在 PhpStorm 中调试项目
Debug Project in PhpStorm
我一直在网上和 Whosebug 上寻找满意的答案,但没有成功。我应该如何使用 PhpStorm IDE 将 Magento 作为整个应用程序而不是单个文件进行调试?您可以在 Visual Studio、Netbeans 和 IntelliJ IDEA 中执行此操作,但我需要知道如何使用 PhpStorm 调试 Magento 等应用程序。
当我尝试 运行 控制器上的调试器时,例如 C:\xampp\htdocs\coinandbuillion\app\code\core\Mage\Checkout\controllers\CartController.php
,会抛出一堆错误,因为 PhpStorm 试图直接执行文件而不是通过应用程序调度程序工作在 index.php
.
那么有谁知道如何从应用程序的初始化点到结束自动调试?
这是我得到的快照。单击该按钮后我无法调试。
我终于做到了!!! :) 请参考我遵循的步骤。
从 Here 安装 Jetbrain 的 chrome 扩展。
现在按照以下步骤操作。
在图像的第 3 个快照中。您的内置服务器端口(我的是 63342)可能与您不同,我没有更改它,它已经存在(默认),我刚刚展示了它。我只更改了其他选项。
就是这样!!
编辑 1:
如果您在图 1 的 php.ini 中编写所有 xdebug 设置时遇到问题,这里是文本版本:不要完全像我那样更改路径 因为你可能在其他驱动器上的不同文件夹中安装了 xampp/wamp。所以请相应地添加像 zend_extension 这样的路径。
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C\xampp\tmp"
xdebug.remote_port = 9000
xdebug.idekey=PHPSTORM
确保以下内容:
确保您已经从 Here
安装了 Chrome 扩展
确保 xampp/wamp 服务器是 运行。
确保配置了 Xdebug 调试器。
如果没有,转到文件->设置->搜索PHP并按照如下图
我一直在网上和 Whosebug 上寻找满意的答案,但没有成功。我应该如何使用 PhpStorm IDE 将 Magento 作为整个应用程序而不是单个文件进行调试?您可以在 Visual Studio、Netbeans 和 IntelliJ IDEA 中执行此操作,但我需要知道如何使用 PhpStorm 调试 Magento 等应用程序。
当我尝试 运行 控制器上的调试器时,例如 C:\xampp\htdocs\coinandbuillion\app\code\core\Mage\Checkout\controllers\CartController.php
,会抛出一堆错误,因为 PhpStorm 试图直接执行文件而不是通过应用程序调度程序工作在 index.php
.
那么有谁知道如何从应用程序的初始化点到结束自动调试?
这是我得到的快照。单击该按钮后我无法调试。
我终于做到了!!! :) 请参考我遵循的步骤。
从 Here 安装 Jetbrain 的 chrome 扩展。
现在按照以下步骤操作。
在图像的第 3 个快照中。您的内置服务器端口(我的是 63342)可能与您不同,我没有更改它,它已经存在(默认),我刚刚展示了它。我只更改了其他选项。
就是这样!!
编辑 1:
如果您在图 1 的 php.ini 中编写所有 xdebug 设置时遇到问题,这里是文本版本:不要完全像我那样更改路径 因为你可能在其他驱动器上的不同文件夹中安装了 xampp/wamp。所以请相应地添加像 zend_extension 这样的路径。
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C\xampp\tmp"
xdebug.remote_port = 9000
xdebug.idekey=PHPSTORM
确保以下内容:
确保您已经从 Here
安装了 Chrome 扩展
确保 xampp/wamp 服务器是 运行。
确保配置了 Xdebug 调试器。
如果没有,转到文件->设置->搜索PHP并按照如下图