Reputation: 9925
I'm using Xdebug/PhpStorm for a long time and never saw this problem:
When I run debugger in PhpStorm, the debugger breaks on the correct line but when I step through the code, it jumps to random places in the code, and the browser receive empty response, with no errors in the log.
More info:
I have a similar setup on the same machine with image mattrayner/lamp:latest-1604 - in this setup the problem does not reproduce
If I set "stop at first line" I can step through the code on the first, but subsequent run will not step though the code , difference: PHP Version 5.5.9-1ubuntu4.27, Ubuntu 14.04.6
when the debugger breaks, any operation will fail - e.g. clicking on run will finish the execution but the browser display empty response and no action executed after the break.
Content of /etc/php/7.3/apache2/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_connect_back=0
xdebug.remote_host=host.docker.internal
Any idea how to solve it?
Tried with different version (7.2, 7.3 , 7.4) - same results:
here is my path mapping
and my Apache conf
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName dev.usaddress.com
CustomLog /var/log/apache2/access.log vhost_combined
SSLEngine on
SSLCertificateFile /app/dev.usaddress.com.crt
SSLCertificateKeyFile /app/dev.usaddress.com.key
DocumentRoot /app/usaddress
<Directory /app/usaddress>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Upvotes: 1
Views: 1565
Reputation: 1
For me this issue was due to a watch expression that was causing an error during evaluation when the first breakpoint was hit. Removing the offending watch resolved it.
Upvotes: 0
Reputation: 9925
close your project
go to the project directory
delete .idea
folder
create a new project with the project directory
go to 'Edit configuration' and recreate your debug configurations
run debuger
Notes:
I was not able to reproduce this bug with a similar env
I was not able to reproduce this bug with a different project running on the same env
therefore, I tried to recreate the project and it solved the problem
Upvotes: 0
Reputation: 1437
You should check your path mapping. That's usually a case for me. It can be mapped correctly in the place where your script firstly enter but can be mapped wrong in some other place. Make sure that you mapped only the root of your project or that you have correct mapping at all possible routes.
Server setting can be found at Languages & Frameworks > PHP > Servers
If you will look on my screenshot you can see that only folder public
is mapped with absolute path on the server (which is /srv/sylius/public
here). That means that other folders will be mapped relatively to this public folder.
If you think that it's not a case than I can advise you only to try manually go through code starting from that place where debugger breaks on the correct line step by step until unexpected behavior occurs. And from that point try to understand why it happening.
Upvotes: 0