We are now ready to launch the prepared WordPress project using PhpStorm Docker tools.įirst, we need to create a Run Configuration. The first one is for the database server: In an empty project folder, we create a docker-compose configuration file, docker-compose-local.yml. The tag used in this project is 5.4.1-php-7.2-apache. The project will use a container built from an official WordPress image. The companion repository for this tutorial can be found on GitHub: wordpress_xdebug Project Setup For simplicity’s sake, we will be debugging an existing theme BeOnePage Lite by BeTheme. The WordPress theme that is the subject of this development project can be a scratch-built custom one or a modification of an existing theme. It should work also with newer versions: download the most recent WordPress and update the reference to the newer WordPress Docker image in the Dockerfile that is mentioned below. The version of WordPress we are going to work with is 5.4.1. To check if it is, go to Settings > Generaland tick the respective checkbox: Make sure the Docker Daemon is exposed on port 2375. This tutorial is written for Windows 10 and Docker Desktop running Linux containers. You will need the Xdebug helper for Chrome or an equivalent helper for other browsers. In this tutorial, we are using version 2019.3.2. On first run, PhpStorm will ask you to map the directories.PhpStorm is a popular PHP IDE with many useful features including Docker and Xdebug support.The web page will begin loading and PhpStorm will prompt for your attention.On the web page navigate to the section where it will trigger the break point.Access the web page on your local machine.Set a break point in your code base in PhpStorm.You can modify the Host and Port to your own settings (the hostname that you use to ssh to the VM).Name should match PHP_IDE_CONFIG previously set.In PhpStorm go to Languages
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |