Unable to debug

I have PhpStorm 2020.1, and have been trying without success to get remote debugging to work. I will first describe my setup.

This is my development system. I run PhpStorm on my macbook pro. My development server is a Ubuntu 18.04 instance running in a VirtualBox VM on the same macbook pro, with host networking enabled. In this setup the Ubuntu VM appears to phpstorm to be a remote device at IP address 192.168.56.105. The macbook pro has an interface assigned to 192.168.56.1. I have one copy of my development website stored locally and managed as a PhpStorm project, and it is also mirrored on the Ubuntu VM. I use the PhpStorm "deployment" feature to keep them synced over an SSH connection. That seems to work perfectly. The PhpStorm project was created using the "Web server is on remote host, file are accessible via FTP/SFTP/FTPS" wizard. Except for debugging this setup appears to work perfectly.

One further complication that my production server runs php 7.3, but the ubuntu repositories want to install php 7.4. To install php 7.3 I added the ondrej/php PPA to my ubuntu repository list and installed php 7.3 from there. I also installed xdebug via apt install php-xdebug. I'm not really sure which repository xdebug comes from. A number of different xdebug.so files are installed into directories in /usr/lib/php. For example, there is a /usr/lib/php/20190902/ and a /usr/lib/php/20180731/xdebug.so, and several others. When I modified /etc/php/7.3/apache2/php.ini to use the xdebug.so in 20190902 I observed the following error message in the Ubuntu logs:
Apr 16 11:09:44 hohokus sessionclean[2669]: Failed loading /usr/lib/php/20190902/xdebug.so: /usr/lib/php/20190902/xdebug.so: undefined symbol: zend_get_properties_for
I have no idea what that error was about, but I switched php.ini to use /usr/lib/php/20180731/xdebug.so and I no longer get that error. I attempt debugging by choosing "Debug" from the run menu. That seems to work, a browser instance is created at the html file I specified. When I submit a form that runs the php script, the script does indeed run, but execution never stops at any of my breakpoints. I have the following three lines in /etc/php/7.3/apache2/php.ini on the Ubuntu VM:

zend_extension="/usr/lib/php/20180731/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host=192.168.56.1
xdebug.remote_port=9000

I have verified the following facts: 1) PhpStorm is listening on port 9000 on all interfaces; 2) I can connect to PhpStorm from a command-line on the Ubuntu VM via nc 192.168.56.1; 3) xdebug never attempts a connection to port 9000 where PhpStorm is listening, verified by listening on the interface with Wireshark. The problem it seems must be with xdebug. Also, when I run the Web Server Debug Validation script from the "Run" menu I get the following result:

 

1
1 comment

That netcat command I ran was actually `nc 192.168.56.1 9000`.

0

Please sign in to leave a comment.