dongwu9170 2015-08-20 13:10
浏览 112
已采纳

PHPStorm和VM单元测试

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, i.e 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 interpreters window

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, i.e. it doesn't seem to be a SSH connection issue, rather smth else.

Would be great to get any hint on this issue.

  • 写回答

1条回答 默认 最新

  • doume1301 2015-08-20 13:54
    关注

    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. I.e. 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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)