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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵