You might also want to debug a command-line application, from within your container. Xdebug CLIĪll applications are not web-based. Jump to chapter "Run Xdebug" to see how to use Xdebug. Indeed, from the point of view of Xdebug, the PHP application runs in the "/var/this point, you should be able to put a breakpoint in your code, start a debugging session and get the application to stop on the breakpoint. (8) Don't forget to click on Use path mappings (7) Add your host on port 80 using Xdebug (5) Once it's done, you are on debug server page. (2) Confirm it by clicking on PHP Web Page Registering your container server in PHPStormįirst, click on edit configurations, on the top right of PHPStorm window. Otherwise, just keep the default configuration port. If you want to use another port for Xdebug, follow the instructions below. This directly conflicts with the XDebug port. In particular, if you are using PHP-FPM, the default port for PHP-FPM is 9000. except if port 9000 is already taken by another program on your host (your machine running PHPStorm). Out of the box, everything should be fine. Our PHP container has Xdebug installed and Xdebug will try to connect to PHPStorm on port 9000 by default. Keep in mind that PHPStorm opens port 9000 (by default) so Xdebug can connect to it. It automatically configures Xdebug for the container. Note: the PHP_EXTENSION_XDEBUG environment variable is specific to the thecodingmachine/php. Image: thecodingmachine/php:7.2-v1-apache My base docker-compose.yml file looks like this: app: If you are starting a project, I recommend you to download one of our images here TheCodingMachine Docker PHP images In my example, I will use a Docker image of TheCodingMachine created by David Négrier. To follow this tutorial, you must have the Xdebug extension installed on your container.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |