drd0833 2017-03-03 22:53 采纳率: 100%
浏览 122


I have problem with xdebug because don't stop in some breakpoints.

My project have MVC architecture and all worked fine with debugging while I created subcontrollers, because in subcontrollers breakpoints not working. If I put xdebug_break() in subcontroller then it works.

I checked xdebug_remote.log

This breakpoint not working

<- breakpoint_set -i 1309 -t line -s enabled -f file:///var/www/my_project/app/controllers/settings/LanguageController.php -n 18
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1309" state="enabled" id="59770002"></response>

This breakpoint working

<- breakpoint_set -i 1310 -t line -s enabled -f file:///var/www/my_project/app/controllers/IndexController.php -n 15
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1310" state="enabled" id="59770003"></response>

It's possible, that namespace is guilty? One difference between controller and subcontroller is namespace. In controller is it not defined, but in subcontroller is defined.

  • 写回答

1条回答 默认 最新

  • dousheyan0375 2017-03-04 12:57

    I solved the problem. I changed the namespace to lowercase before was in camelcase and I changed register namespace on exactly folder structure.

    Before in controller:

    namespace MyApp\Controllers\Settings;

    in loader.php

    $loader->registerNamespaces( [ 'MyApp\Controllers\Settings' => DIR.'/../controllers/settings' ] )->register();

    After (properly working)

    in controller:

    namespace app\controllers\settings;

    in loader.php

    $loader->registerNamespaces( [ 'app\controllers\settings' => DIR.'/../controllers/settings' ] )->register();
    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥60 如何把照片修复成原始拍摄图
  • ¥80 Exited too quickly (process log may have details)
  • ¥15 爬知乎登录之后内容加载不出来
  • ¥15 怎么用protues测量通频带
  • ¥15 zepelin使用sparkInterpreter 异常
  • ¥15 paho mqtt 接收不到消息
  • ¥15 函数r关于两个分量y,z方向上的图像,分开画r随y的图像,r随z的图像
  • ¥15 如何用Matlab求Pearcey函数的数值积分?
  • ¥15 一个简单的函数定义问题,输出结果是相反的,怎么回事呢?
  • ¥15 页面加载报错,不知道怎么处理