Click the + button and then go to "From Docker, Vagrant, VM, Remote…` (if this option is not available, you may need to enable the Remote PHP Interpreter plugin in PhpStorm)
Enter the following details:
Host: This can be found by going to the site in Local and then copying the “Remote Host” option in the “Database” tab
Port: See Step #1.5 at the beginning of this article
User name:root
Password:root
PHP interpreter path:/usr/local/bin/php
Hit OK then Apply
Change the PHP language level option to whatever matches the PHP version that the Local site is running
Click on ... beside “Path mapping”
Map the site’s public folder in the project to /app/public
Thank you Clay. While I went through this, I decided to take notes on the issues I ran into to help anyone who’s going through these steps.
Problem 1:
When I ran phpunit --verison, I ran into this error: cannot use PHPUnit\Framework\MockObject\Stub as Stub because the name is already in use in phar:///usr/local/bin/phpunit/phpunit-mock-objects/Builder/InvocationMocker.php on line 16
Solution 1:
And I resolved it by updating my PHP version to 7.1.4.
Problem 2:
After clicking "From Docker, Vagrant, VM, Remote I didn’t see “Host”, “User Name”, etc…
Solution 2:
I had to click the SSH Credentials radio button to display these configurations
Problem 3:
It wasn’t clear to me that I needed to click "PHPUnit By Remote Interpreter on step 11
Solution 3:
Well, I clicked on “PHPUnit By Remote Interpreter” before moving on to step 11
Problem 4:
I was getting errors on step 13.
Solution 4:
This was solved, again, by using PHP 7.1.4
I believe I have the same issue, stuck on Provisioning, does not go past that point.
Also I noticed if I force quit after 20min or so and restart and try again the new port when trying to add SSH has incremented by one, i.e from 4033, 4034, 4035 each time I try and you cant change that field.
LBFW 2.4.5
VB 5.2.20
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-machine] checking IP
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-machine] checked IP 192.168.95.100
Nov 16, 2018, 11:38 AM GMT+10 - info: [EnvironmentCustom] Empty /etc/mysql
Nov 16, 2018, 11:38 AM GMT+10 - info: [EnvironmentCustom] Copying MySQL config to container prior to starting.
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/waitForFile] Waiting for /conf/php/7.1.4/etc/php-fpm.conf da8509b02a193c18fa1fa75689a865fc791c8e5b5508d498b208f009eb84260b
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-router] getRouterContainers()
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-router] teardown()
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-router] Removing router container 76979bc2f905bd7e2da32b48b7789cc587933000a587cd77ef4bc2975ffadec1
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-router] updateProxyManager()
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-router] runContainer()
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-network-manager] removeExistingNetworks
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-network-manager] createNetwork
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/waitForFile] /conf/php/7.1.4/etc/php-fpm.conf exists
Nov 16, 2018, 11:38 AM GMT+10 - info: [main/docker-router] reconnectNetwork()
Nov 16, 2018, 11:38 AM GMT+10 - info: [EnvironmentCustom] Starting php-fpm done```
My need wasn’t for PHP unit, but searching if it was possible to connect with SSH to container. And how to do it with security (adding this possibility only for a user with a specific password …)
As I read this tutorial carefully, I have followed Step1 and Step2 and I wonder… Isn’t it dangerous to install OpenSSH-server in a Local By Flywheel container and give the ability to connect to container with root / root ? Anyone discover your Remote Host and Port can connect with SSH and then break everything… isn’t it?
… …
Finally, I tried an SSH connection with an external PC to the one containing LBFW and the result is a connection timed out! So, everything is OK!!!
The Ports extension is deprecated, and I don’t see any way to add ports in Local Lightning. Is there any way to use PHPUnit and PhpStorm with Local Lightning?