![phpstorm debug php phpstorm debug php](https://imgs.developpaper.com/imgs/3466490820-5c1cb228bcdc1_articlex.png)
In general, there are two ways to run PHP from PhpStorm using Docker: Git checkout part_2_setting-up-phpstorm-with-xdebug-for-local-development-on-dockerįurther, make sure to open /c/codebase/docker-php-tutorial as a project in PhpStorm. (unless you've already done that in part 1), checkout branch part_2_setting-up-phpstorm-with-xdebug-for-local-development-on-docker andĪs in part 1, I'm assuming your codebase lives at /c/codesbase: cd /c/codebase/ I'm gonna walk you through all the necessary changes,īut I'd still recommend to clone the corresponding git repository docker-php-tutorial
#PHPSTORM DEBUG PHP HOW TO#
Luckily, we already have a good understanding on how to create the container, although we'll need to make someĪdjustments to make everything work smoothly with PhpStorm. We will only need the php-cli container for this part.
#PHPSTORM DEBUG PHP SERIES#
There will be a another part of this series that will deal with all of those (and some more common) problems andĪims at providing a consistent development environment for all developers in a team (regardless of the OS they are using).
#PHPSTORM DEBUG PHP CODE#
![phpstorm debug php phpstorm debug php](https://www.previousnext.com.au/sites/default/files/styles/content_1x/public/2021-08/phpstorm-xdebug-server.png)
Go to Preferences > PHP > Debug > Dbgp Proxy, set like this (note: IDE Key must same with the value of xdebug.idekey on php.ini):Ĭ. Go to Preferences > PHP > Debug, set like this:ī. After selecting an Interpreter, we are going to map our working project with container path, my working project path is $HOME/DOO/api docker and I will map into /var/www/, so change the Docker container value:Ī. Go to `Preferences > PHP, add new interpreter, select new interpreter from Docker, vagrant, etc.Ĭ.