remote debugging problem

I have problem with remote debugging. (never did this before).
I have a project. It's hosted on a remote server. I have access to /var/www/ of this server over samba share folder.
I have a local copy of that project. xdebug is installed and configured on the remote server. Created network drive to this samba folder with /var/www
Added project from existing sources. Selected my local copy of the project. On connection tab selected As upload/download folder my mounted folder.. (Y:\var\www\my_name\project_name), webserver root url: http://remote.server/), on mapping tab - local path to a local copy of the project ( C:\www\project_name, deployment path on server (relative to folder Y:\var\www\my_name\project_name - \, web path on server /my_name/project_name, project url is correct: http://remote.server/my_name/project_name
I need to debug one special part of the project.. script is in /modules/mod_name/core/bla.php, put there a brake point where I need it.
in order that script is accessed by project.. I have to visit some special page (landing page) http://remove.server/my_name/project_name/category_name -> for generating this seo urls project uses special class.. and special script.. let it be - seogen.php. (I put brake point in bla.php remember?). I put xdebug cookie and reload page. phpstorm brakes at 1st line of that seogen.php (i'm on /category_name/ ). if I step over or something.. it just ends on that script and debugging is finished.. it doesn't even come to the script I put brake point in.. I can step into then it begins to jump from script to script and goes it line by line.. spent 5 mins by stepping into but still wasn't on the correct script I want to debug... if I put cursor on line which I want to debug.. and do - run to cursor - it just finishes debugging. try to validate debugging (don't know if it's important or not..)
anyway it fails.. it tells me
Server name: remote.server
loaded php.ini: /usr/local/php54/etc/php.ini
debugger extension: Xdebug 2.3.3
Remote host is configured as 'localhost' despite server host is probably not local ( The host where the debugger client is running. See http://xdebug.org/docs/all_settings#remote_host for more information. )
remote port: 9000
remote connect back option is enabled ( xdebug.remote_host option will be ignored. See http://xdebug.org/docs/all_settings#remote_connect_back for more information. )
remoted mode: 'req'

I click validate and it does nothing. connect back does make that remote_host option IS IGNORED. is good.. but why then it doesn't VALIDATE?
why I can't debug script I want to debug? why it doesn't stop on my brake point? (enabled and disabled stop on first line but it still doesn't go to my brake point)

6 comments
Comment actions Permalink

Hi there,

So far it looks like a problem with path mappings or such file is outside the project. It could also be because of wrong letter case (File <> file).

Also -- it could also happen because of symbolic links on your server. You have top remember that xdebug always works with final/resolved URLs while PhpStorm as is.

1. Please show header + xdebug section of phpinfo() output captured via browser
2. Enabled xdebug logging -- http://xdebug.org/docs/all_settings#remote_log (don't forget to restart Apache) and try to debug again. Then attach that log here (without modifications)

0
Comment actions Permalink

I have no access to the log and xdebug configuration

if there is issue with filenames and symlinks.. should I try to configure phpstorm on linux? would it fix the issue?



Attachment(s):
Screenshot_2.png
Screenshot_1.png
Screenshot_3.png
0
Comment actions Permalink

Well ... you need logs to see what path xdebug tries to debug and what path IDE tries to use. It could be that your top level folders are OK but only some subfolder uses symlink. Better ask your sys admin for that.

I recommend placing xdebug_break(); (programmatic breakpoint) in your code instead of actual IDE breakpoint (and remove all other breakpoints) and see what IDE & xdebug log will say about it.

In any case: if you know that the symlinks (or just different path) could be the reason -- you can fix it with correct path mappings in "Settings/Preferences | Language & Frameworks | PHP | Servers"

1
Comment actions Permalink

xdebug_break(); worked like a charm. thank you. asked my sysadmin for logs but anyway with hardcoded break point it works and stops the script at the point I put it in. I'll post the log as soon as I get them

0
Comment actions Permalink

If that works then it's pretty unlikely to be the path issue.

What sort of lines/statements you were trying to put breakpoint on before? Show me a screenshot please (point to exact line).

0
Comment actions Permalink

(necroposting)

 

Maybe it's still a relevant information as I stumbled on this thread for the same reason as the original poster, and here's the "trick": don't be like me and don't forget to restart PHP5-FPM (and CLI if you are using that service), not only your web server (nginx in my case).

So after you edit your configuration files for xdebug (be it xdebug.ini or directly in php.ini), you'll need to restart the PHP interpreter service as well - of course only if you are using it as a service.

0

Please sign in to leave a comment.