简体   繁体   中英

PHPStorm and VM unit tests

I'm trying to setup remote tests execution and debugging in PHPStorm following those two articles from JetBrains:

I'm working in PHPStorm 9.0.2 on Windows 8.1, and my VM is Debian Jessy sitting inside Virtual Box v 4.3.26. VM is connected to host OS via host-only interface. Host machine has IP 192.168.10.1 and guest one has IP 192.168.10.2.

My problem so far is remote interpreters in PHPStorm, ie if I do:

  1. Go to PHPStorm setting
  2. Find Languages & Frameworks -> PHP
  3. See Interpreter option and click the ... button to open the interpreters Window.
  4. Specify my connection settings as on attached screenshot
  5. If I press button 1, then PHPStorm shows a choose-folder dialog which corresponds to server file structure and I can actually choose the right path to php executable there. PHP is indeed located at /usr/bin/php .
  6. If I press button 2, then dialog 3 appears and stays on the screen forever. The only way to get rid of it is to kill network connection or kill PHPStorm. PHPStorm PHP解释器窗口

I tried googling the issue, but failed to find anything related. My private key file is in PuTTY *.ppk format. My user has permissions to write and read from project folder, though it is not the same user as apache uses.

If I go to Tools -> Start SSH session then PHPStorm starts a terminal session using provided credentials, ie it doesn't seem to be a SSH connection issue, rather smth else.

Would be great to get any hint on this issue.

Looks like I spotted the issue. Problem is that I was initially trying to run unit tests from the console and expecting PHPStorm to stop on breakpoints inside unit-tests. This was not happening, but PHPStorm was stopping before the first line of code of the PHPUnit.phar file, and sadly that continued to happen. Ie when PHPStorm validates the php setup it seem to execute some php command and that command is either waiting for ages till other php thread get released or gets suspended before it's first line execution.

So, I restarted PHPStorm, deactivated listening to xdebug connections and things started to work as they should according to JetBrains docs mentioned in the question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM