![]() ![]() The last step to get your interactive debugger working is to open Run/Debug Configuration and create a new “PHP Remote Debug” configuration. I noted all the components that required for the server settings in the image below. Go to PHPStorm preferences > Languages & Frameworks > PHP > Servers, here you can configure PHPStorm server settings for the debugging. ![]() If you don’t have any preconfigured CLI yet, create one from the plus symbol (red-marked), and choose create from Docker image/docker-compose.yml when prompted. The CLI in the image was configured based on Docker image, with Xdebug correctly detected. If you opt to configure a new CLI, verify that the IDE correctly detects the interpreter executable and debugger availability status after configuration. Otherwise, the three-dot button (red-marked in the image) will help you configure your CLI that will be used during the debugging process. If you already configured the CLI before, you can see it here. PHPStorm will import the settings and magically getting CLI interpreter configs into place. In the PHP section in PHPStorm setting, create a new CLI interpreter config from your docker/docker-compose setting. Next, docker-compose restart (or if you don’t use docker-compose then it should be docker container restart) to restart the container and make the changes take effect.įinally, verify that the PHP > Debug section in your PHPStorm setting to make sure that the Xdebug port there points to the same port you defined in the xdebug.ini file. # For Xdebug version 3.x zend_extension =xdebug.so Way to install xdebug varies as per environment and php distribution, however if your environment is using php 7.4 or newer, chance that pecl install xdebug should suffice.Īfter installing Xdebug, create a file named xdebug.ini under //conf.d/ and save these lines into it (note that you can use php -ini to know where your php configs are located at): If you don’t already have Xdebug installed, you need to install it before continuing. Install Xdebug plugin for PHP and config Xdebug to play well on Dockerĭouble-check if the PHP version installed in your Docker container already has Xdebug (by using command php -v and see if the output says anything about Xdebug). This article will guide you through how to achieve that with the context of a Laravel web application in a Docker container and about debugging a Laravel web application running on a web server. Technologies jetbrains phpstorm php laravel dockerĪlso, learn how to debug Laravel artisan command here and debug Laravel unit test here.įind yourself having too many times adding and removing Log::debug() or such value-output-based debugging method just to inspect variables or process flow? Switch to step-by-step code execution, breakpoint-based debugging using IDE (PHPStorm) and XDebug to save time and your sanity. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |