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

NetBeans不会在PHP代码中的某些断点上停止

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();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面
  • ¥15 算法题:数的划分,用记忆化DFS做WA求调
  • ¥15 chatglm-6b应用到django项目中,模型加载失败
  • ¥15 CreateBitmapFromWicBitmap内存释放问题。
  • ¥30 win c++ socket
  • ¥15 C# datagridview 栏位进度