Objective
I built the Php+laravel development environment with Docker on the local Ubuntu machine, but configured the remote PHP interpreter (the PHP interpreter in the Docker container) and the connection docker in the local 2016.3.2 version of Phpstorm API found Unable to connect, Google for a long time found in the UNIX system Docker default to use the socket file/var/run/docker.sock, so in the Phpstorm configuration Docker should be in the API URL This column to enter Unix:///var/run/docker.sock. Of course, besides this, there are other ways. specific steps to edit the Docker host file/lib/systemd/system/docker.service
sudo vi/lib/systemd/system/docker.service modify a line that starts with Execstart
Execstart=/usr/bin/docker daemon-h fd://-H tcp://0.0.0.0:4243 Save modified file Notification Docker service make changes
Systemctl daemon-reload Restart Docker service
sudo service docker restart test can be connected to the Docker API
Curl Http://localhost:4243/version
If the Docker host and the Phpstorm host are not the same machine, then use the ifconfig command to view the Docker host's IP address (such as 192.168.1.68) when configuring Phpstorm on the Docker on the API URL This column should be filled in http://192.168.1.68:4243