View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001610 | Xdebug | Installation | public | 2019-01-16 16:06 | 2019-08-01 14:06 |
Reporter | cegprakash | Assigned To | derick | ||
Priority | high | Severity | block | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Platform | Linux | OS | Ubuntu | OS Version | 16.04 |
Product Version | 2.6.1 | ||||
Summary | 0001610: xdebug socket creation fails | ||||
Description | Here is my xdbug log. Log opened at 2019-01-16 15:46:04 my php -m has xdebug under both [PHP Modules] and [Zend Modules] in phpinfo() I see the zend logo with the following message This program makes use of the Zend Scripting Language Engine: Loaded Configuration File /etc/php/7.2/apache2/php.ini | ||||
Steps To Reproduce | sudo apt-get install php-xdebug Open /etc/php/7.2/apache2/php.ini Add zend_extension=/usr/lib/php/20151012/xdebug.so [XDebug] | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Operating System | |||||
PHP Version | 7.2.10-7.2.14 | ||||
|
Can you reproduce this problem on the command line as well? It might be worth trying that. Run your PHP script as follows: USE_ZEND_ALLOC=0 XDEBUG_CONFIG="idekey=cegprakash" php -n -dzend_extension=/usr/lib/php/20151012/xdebug.so -dxdebug.auto_start=1 -dxdebug.remote_log="/usr/lib/php/xdebug-logs.log" your-simplest-script.php And then check again what is in /usr/lib/php/xdebug-logs.log |
|
Yes I get the same logs. I also get the following message in command line Xdebug requires Zend Engine API version 320151012. |
|
So I tried SE_ZEND_ALLOC=0 XDEBUG_CONFIG="idekey=cegprakash" php -n -dzend_extension=/usr/lib/php/20170718/xdebug.so -dxdebug.auto_start=1 -dxdebug.remote_log="/usr/lib/php/xdebug-logs.log" info.php and it just prints the same log Log opened at 2019-01-23 10:49:30 |
|
Just a note to say I'm seeing this precise issue with Xdebug 2.7.1 on an Ubuntu 18.04 Vagrant machine, which is being debugged by PHPStorm under Mojave. The command run by PHPStorm was And the resulting log entry was as follows: If I can run any other tests to help isolate the issue, please let me know. |
|
Might be worth noting that the following from inside the Vagrant machine: nc -vz 172.16.141.2 9000 |
|
@Kier — that sounds like a networking issue on your side. If Xdebug/PHP can't connect to the IDE, then it can't debug. Your "nc" call just proved that it can't connect, which means that PhpStorm is not listening on port 9000 on IP address 172.16.141.2. That looks like an internal Vagrant IP address, which is likely not shared through to PhpStorm. I'd recommend you put Vagrant's network into "Bridged" mode, instead of the (Default) NAT. |
|
@derick This is starting to look like an issue with Vagrant, VMware Fusion or PHPStorm but I thought it would be useful to update this report anyway with my findings. The virtual machine reports the following IP configuration: eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 Debugging PHP scripts running through Apache into Chrome is working flawlessly. The debug logs show that the connection is passing to 192.168.33.1, which is using the vmnet2 interface on the virtual machine (fig: net2.png). [1307] Log opened at 2019-07-23 13:43:27 However, using the standard PHPStorm config, which is to 'Pass required configuration options through command line' (fig: config.png), it would appear that PHPStorm will instead attempt to connect through the first defined network interface, which is the 172.16.141.x address we see (fig: net1.png). Connection over port 9000, or any other port that I have tried, is refused. Using these options, the following debug command is run: [vagrant:///Users/kier/Sites/xf-sbp]:/usr/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=172.16.141.2 /var/www/public/xf/cmd.php Clearly, PHPStorm is connecting to the wrong IP for the virtual machine, but there doesn't appear to be a way to correct that, so instead it is necessary to disable that option to have PHPStorm send command-line configuration, and instead we must rely on Xdebug config itself. Setting xdebug.remote_host = 192.168.33.1 and disabling PHPStorm's "Pass required configuration options through command line" option allows debugging to work correctly. [vagrant:///Users/kier/Sites/xf-sbp]:/usr/bin/php /var/www/public/xf/cmd.php results in [2276] Log opened at 2019-07-23 14:01:10 |
|
Hi Keir, I would log a support question with PhpStorm, as in my opinion, they do this wrong. I fail to understand how they get that IP address in the first place, but that's something for them to investigate. cheers, |
|
Will do, @derick. Thanks for a great project in Xdebug. |
|
I'm closing this issue, as so far, there is nothing that indicates that Xdebug is doing something wrong. cheers, |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-01-16 16:06 | cegprakash | New Issue | |
2019-01-22 22:07 | derick | Note Added: 0004826 | |
2019-01-22 22:07 | derick | Assigned To | => derick |
2019-01-22 22:07 | derick | Status | new => feedback |
2019-01-23 10:20 | cegprakash | Note Added: 0004839 | |
2019-01-23 10:20 | cegprakash | Status | feedback => assigned |
2019-01-23 10:56 | cegprakash | Note Added: 0004841 | |
2019-07-23 12:31 | Kier | Note Added: 0005087 | |
2019-07-23 12:32 | Kier | Note Added: 0005088 | |
2019-07-23 13:02 | derick | Note Added: 0005089 | |
2019-07-23 14:03 | Kier | File Added: net1.png | |
2019-07-23 14:03 | Kier | File Added: net2.png | |
2019-07-23 14:03 | Kier | File Added: config.png | |
2019-07-23 14:03 | Kier | Note Added: 0005090 | |
2019-07-24 10:38 | derick | Note Added: 0005091 | |
2019-07-24 10:42 | Kier | Note Added: 0005092 | |
2019-08-01 14:06 | derick | Status | assigned => resolved |
2019-08-01 14:06 | derick | Resolution | open => no change required |
2019-08-01 14:06 | derick | Note Added: 0005098 |