phpstorm xdebug with a symfony2 project

前端 未结 5 1195
無奈伤痛
無奈伤痛 2021-02-04 11:52

I am trying to debug a symfony2 application with xdebug and phpstorm.

My local development environment is Ubuntu 14.04 with apache2 and Xdebug version is 2.2.7

I

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-04 12:20

    I had a similar issue which again proved to be a mapping problem, debugging a Symfony 2 project remotely using PHPStorm.

    If PHPStorm can't map the src file locations, it will break on the first line of code in app_dev.php (if you've set 'Break on first line') but then continue straight through any break points set in /src (e.g. Controllers, Models, etc.) and doesn't flag any error.

    1. Go to Setting -> Languages & Frameworks -> PHP -> Servers
    2. Select your server in the middle-left pane (or add using '+')
    3. Check 'Use path mappings (select if the server is remote or symlinks are used)'
    4. Add mappings such that /app, /src and /web are mapped. These can be individual mappings, but it's better if possible to set a higher level mapping on / which covers them all.

    Once PHPStorm can map these paths, it stops and breakpoints and meaningful debugging can begin.

提交回复
热议问题