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 如何使用simulink建立一个永磁同步直线电机模型?
  • ¥30 天体光谱图的的绘制并得到星表
  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗