Home>Article>Development Tools> How to develop docker with phpstorm under win10
The following tutorial column ofphpstormwill introduce to you through pictures and text the method of developing win10 with phpstorm using docker. I hope it will be helpful to friends in need!
Today I saw the community's article Windows10 use PHPSTORM and Docker to build Hyperf I have itchy hands for a while, and I want to recall whether the experience of using docker under Windows is better, and record it.
Docker Desktop
PhpStorm
Installing Docker Desktop will use the wsl function. First install Ubuntu 20.04 LTS, and then install something similar to a plug-in
There is still a problem with starting later, and I have repeatedly uninstalled, restarted, installed, and restarted. solution .
also refers to this. Just follow the above steps to restart the computer and it will be fine. This is not needed.
To configure the Alibaba Cloud Image Accelerator, you need to register an account.
I don’t know what went wrong. PhpStorm has been unable to connect to docker, but PyCharm can connect to it
I have been struggling with this error for at least two hours. I have installed, uninstalled and restarted various operations. I have adjusted the network card driver several times and it still doesn’t work. I’ll try again next time.
Use PyCharm for subsequent operations.
First create two empty folders.
D:\docker\mirror
D:\docker\mirror\hyperf
Fill in the following configuration
# hyperf docker 官方镜像版本地址 https://hub.docker.com/r/hyperf/hyperf/tags hyperf/hyperf:7.4-alpine-v3.14-swoole hyperf9501:9501D:\docker\mirror\hyperf:/data/www/hyperf
Start the container and you can see logs, properties, environment variables, ports, mounting directories and other information on the toolbar.
You can also see the started container on Docker Desktop:
Enter the container and set composer first Mirror and then create the project.
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer composer create-project hyperf/hyperf-skeleton ./ --no-interaction
After successful execution, the file synchronization inside the container can be seen in the folder.
Add the Command item in the docker configuration:
# 目录要跟自己创建的目录一致 php /data/www/hyperf/bin/hyperf.php start
Restart the container and visithttp:/ /localhost:9501/
If you are developing, you need to modify the file and restart the container to see the modification.
I haven’t touched docker for several years, and it still feels quite difficult to use (manual dog head), and I am still too good at it. .
The above is the detailed content of How to develop docker with phpstorm under win10. For more information, please follow other related articles on the PHP Chinese website!