naxsell.blogg.se

Phpstorm 2019 debug php application in docker container
Phpstorm 2019 debug php application in docker container







Then let’s create a new Environment, select the Web server environment then we need to configure a few key things. Go to Elastic Beanstalk console, click on new Application, I named mine testxdebugtut. So if you close the terminal/session it will close the tunnel as well. Images below for convince.Ībove we set the values to enable the SHH tunnel, the tunnel will be open whenever this SSH connection is open. This will be used as our SSH authentication to the server. We will then use the SSH tunnel and “link/forward” port 9000 of the server to port 9000 of our local machine that has the IDE and Xdebug client running.ĭownload the key, open Putty Keygen, then import the. Thus we will let Xdebug only use the local host (127.0.0.1) address when running and expecting connections. We don’t want just anyone to connect to our instance that has Xdebug enabled. The second reason for the SSH tunnel is for security purposes. As both the server and IDE needs port 9000 open, this is not always possible and easy in a corporate environment either. The advantage of the SSH tunnel is that it circumvents any potential firewall problems that we might have.

phpstorm 2019 debug php application in docker container

We just need to create an SSH tunnel using putty so that the server can communicate with our IDE that uses Xdebug. ebextension files within the application code handles all of the server config. We don’t need to SSH and do any commands on the instance, the. Then we need to create a Key pair so that we can SSH to the instance. (Actually I do not think we need to have this port open, since we are using the SSH Tunnel that goes through port 22) Below is a screenshot of the security group inbound rules, note that all traffic is allowed on the outbound rules. This port is used by Xdebug communication. To create a security group, go to EC2 -> Security Groups, then create a new one if you do not already have one that has the basics and then port 9000 open. Let’s create an Environment, nothing special here, we just need to make sure that we create a SSH Key pair and have the correct security group.

  • Basic knowledge about AWS, EB, SecurityGroups and keys.
  • Config PHP Storm to use the debugger and test.
  • extension files to install and config Xdebug then deploy new version

    phpstorm 2019 debug php application in docker container

    Create new EB Application, then PHP web server environment, using the sample project.

    phpstorm 2019 debug php application in docker container

    Getting Xdebug running is usually a pain on a normal PHP server, Elastic Beanstalk (EB) makes this even more difficult as AWS has done some interesting things to the server.









    Phpstorm 2019 debug php application in docker container