11/7/2023 0 Comments Phpstorm remote debugDebug your PHP in Docker with Intellij/PHPStorm and Xdebug (forked from the above)Ĭreate your own Dockerfile with your own configuration and add the below to install Xdebug: FROM php:5.Debug your PHP in Docker with Intellij/PHPStorm and Xdebug.The configuration used in this set up is essentially a summary from these two sources: With the above set up, we essentially want to use PhpStorm to debug a remote server. So: changes in code in PhpStorm is reflected in the VM and hence reflected in the docker container. In the VM, this shared folder is also mounted as a volume on the docker container. So changes I make to this folder is reflected in the VM and vice versa. This local folder is then mounted as a shared folder on the VirtualBox VM. The PhpStorm project is located in a local folder on my host. I have PhpStorm installed on my host (not my VM).My docker containers are based on the LAMP stack.I did not opt to run Docker using Docker for Mac or Docker Toolbox, I just ssh into my Ubuntu VM and run docker natively from there. A local VirtualBox VM running Ubuntu 16.04 Xenial with the latest docker-engine installed.You do not need to use the exact set up, but the configuration to follow assume that you are using this set up. The following describes my set up of the development environment. Using Docker in a VirtualBox setup either using docker-machine or an Ubuntu VM. Using Docker (with the official PHP image).This post assumes you have the following set up: This is because we are not integrating PhpStorm fully with Docker, we are merely using PhpStorm for debugging purposes. We will not be using the official Docker Support in PhpStorm. This post outlines the configuration needed to incorporate the debugging power of the PhpStorm IDE to your PHP based web app. However, these tools become difficult to use when you decide to include Docker in your workflow. These debugging tools are very useful in a local development environment, you can view the states of variables, indicate line breaks etc. There are many tools that can be used for debugging when developing a web app using PHP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |