调试Magento Standard.php时出错

调试Magento Standard.php时出错,php,magento,debugging,phpstorm,xdebug,Php,Magento,Debugging,Phpstorm,Xdebug,我正在尝试调试Magendo 1.9.2.4app\code\core\Mage\core\Controller\Varien\Router\Standard.php。我正在将PhpStorm与Xdebug一起使用 在调试期间,它向我显示了一个错误,它无法找到它所引用的类Abstract 以下是完整日志: C:\xampp\php\php.exe -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000

我正在尝试调试Magendo 1.9.2.4
app\code\core\Mage\core\Controller\Varien\Router\Standard.php
。我正在将PhpStorm与Xdebug一起使用

在调试期间,它向我显示了一个错误,它无法找到它所引用的类
Abstract

以下是完整日志:

C:\xampp\php\php.exe -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 C:\xampp\htdocs\vaimo\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php
PHP Fatal error:  Class 'Mage_Core_Controller_Varien_Router_Abstract' not found in C:\xampp\htdocs\vaimo\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php on line 28
PHP Stack trace:
PHP   1. {main}() C:\xampp\htdocs\vaimo\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php:0

Fatal error: Class 'Mage_Core_Controller_Varien_Router_Abstract' not found in C:\xampp\htdocs\vaimo\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php on line 28

Call Stack:
    0.0699     193008   1. {main}() C:\xampp\htdocs\vaimo\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php:0


Process finished with exit code 255

Class
Standard
扩展自
Abstract
类,该类位于不同的文件中,但与
Standard
位于同一文件夹中,您这样做是错误的

您正在CLI环境中调试代码(“PHP脚本”类型的运行/调试配置)。这样,您直接在终端中执行
C:\xampp\htdocs\vaimo\app\code\core\Mage\core\Controller\Varien\Router\Standard.php
文件,因此不会执行Magento的引导代码(类自动加载等),php(是的,此错误来自php解释器本身)无法找到父类

解决方案:不要在CLI模式下使用“PHP脚本”类型的配置进行调试——而是使用正确类型的配置通过浏览器作为Web应用程序进行调试。这样,正常的Magento例程将就位(自动加载/配置/db连接/etc)--

  • --使用xdebug浏览器扩展从浏览器启动调试或手动设置cookie/xdebug参数时