Zend Framework compatibility

2010-05-15
2013-05-21
  • I was wondering if there was an easy way to get this plugin to work with Zend Framework.  If you set any breakpoint prior to where Zend Framework rewrites the URL the plugin functions fantastic, but anything after the URL Rewrite results in "Unable to map filename …" Is there a particular combination of remote and local path configurations that would work?

     
  • mike dee
    mike dee
    2010-05-15

    I've been using the plugin with ZF for some time now without issue - if you will post your config/setup I can compare to mine and see if there are any differences.  I know that with the front controller MVC there are a few page reloads in the debugger that occur each time you debug a page but as long as you allow the debugger to run to completion before launching the next session you should be good.

     
  • The website is running on Apache localhost.

    In DBGp config I have:
    Remote Server IP: 127.0.0.1
    IDE KEY: netbeans-xdebug (I match this value in php.ini and this is the default value set by the firefox easyXdebug addon)
    RemotePath: C:\floralambiance\public\
    LocalPath: C:\floralambiance\public\

    index.php which bootstraps and runs the standard Zend application is located in C:\floralambiance\public.

    My php.ini file:
    zend_extension="C:/php-5.3.2-Win32-VC6-x86/ext/php_xdebug-2.1.0RC1-5.3-vc6.dll"
    xdebug.profiler_output_dir = "C:/floralambiance/application/tmp"
    xdebug.profiler_output_name = "cachegrind.out.%p"
    xdebug.profiler_enable = 0
    xdebug.profiler_append=0
    xdebug.extended_info=1
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_host=127.0.0.1
    xdebug.remote_port=9000
    xdebug.idekey=netbeans-xdebug
    xdebug.remote_log="C:/floralambiance/application/tmp/xdebug_remot.log"
    xdebug.show_exception_trace=0
    xdebug.show_local_vars=9
    xdebug.show_mem_delta=0
    xdebug.trace_format=0

    If I then place a breakpoint in GroupController, for occasionAction and call this url (after enabling the firefox addon):
    http://localhost/group/occasion/id/2

    I receive this error:
    Unable to map filename: C:\floralambiance\application\modules\public\controllers\GroupController.php (ip: 127.0.0.1 idekey: netbeans-xdebug) unix: 1

    If I place the breakpoint above the frontController MVC section of index.php file, everything functions perfectly.

    Here is the DBGp result:

    Accept: 127.0.0.1
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/floralambiance/public/index.php" language="PHP" protocol_version="1.0" appid="4004" idekey="netbeans-xdebug"><engine version="2.1.0rc1"><![CDATA]></engine><author><![CDATA]></author><url><![CDATA]></url><copyright><![CDATA]></copyright></init>
    Send: feature_set -i 1 -n max_depth -v 3
    Send: feature_set -i 2 -n max_children -v 15
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"></response>
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>


    Send: breakpoint_list -i 3
    Send: run -i 4


    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="3"></response>


    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="4" status="stopping" reason="ok"></response>
    Send: run -i 5


    Disconnect: 127.0.0.1

    I'm running notepad v5.6.8 (UNICODE)

    I hope I haven't spammed you out with all that, thanks for the help, =)

    -Ryan

     
  • Thanks to the excellent help of Mike D'Ambrogia walking me through his configuration, this is what I ended up with that worked:

    Environment:
    Windows XP Professional
    Apache 2.2
    PHP 5.3
    xDebug 2.1.0RC1 (php_xdebug-2.1.0RC1-5.3-vc6.dll)
    DBGP Plugin 0.0.11.20 (beta)

    Apache:
    C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ is the root folder where my web pages are served on my local machine

    php.ini:
    xdebug.remote_host=127.0.0.1
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp

    DBGP Plugin Config:
    Remote Server IP: 127.0.0.1
    IDE KEY: netbeans-xdebug (To match the value from easy xDebug 1.4 Firefox extension)
    Remote Path: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\
    Local Path: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\

    IMPORTANT:
    Make sure there is a check next to both of these:
    "Bypass all mapping (local windows setup)"
    "Use SOURCE command for all files and bypass maps"

    Fantastic plugin!