poplaacademy.blogg.se

Phpstorm debug php
Phpstorm debug php












Next, PhpStorm will ask you to “Add Local Server”. Select the folder and click the “Next” button to continue. By default, DesktopServer creates your site root as a folder with the same name as your website’s domain name and as a sub-folder at. PhpStorm will then prompt you to “Choose Project Directory”. Therefore, when PhpStorm prompts you to “Choose Your Scenario”, simply select the first option titled, “Web server is installed locally, source files are located under its document root”. From PhpStorm’s main dialog, select the option to “Create New Project from Existing Files”.ĭesktopServer will personalize your website project with its own isolated, unique domain name in addition to its own document root. Adding your existing website to PhpStorm requires a few extra steps.

#PHPSTORM DEBUG PHP HOW TO#

The next step is to make PhpStorm know how to use Xdebug.įor that, we have to click in the arrow placed in the right-top corner of the IDE, and select “Edit Configurations”.If you haven’t already created a DesktopServer website, take a moment to try the simple website as outlined in “Getting Started with DesktopServer”, steps 1 to 10. Now, we should be able to access the web server running in the container with the URL (even if we get a 403 error). Note that we have mapped container’s port 80 to host’s 8080, to avoid conflicts in the case of having some web server running in the host. Taking all this into account, we would create the container executing: docker run -p 8080:80 -d -name=myphp1 -e XDEBUG_CONFIG="remote_host=172.16.209.148" -v /home/julen/PhpstormProjects/phpstorm-docker-xdebug:/var/www/html myphp In my case, the IP address is 172.16.209.148.Īs said before, we also need the path of the project in the host, in order to map with the web directory in the container.

phpstorm debug php

# Path to the Dockerfile.įor creating the container, we need the IP address of the host, since Xdebug needs the remote host IP, which will be passed to the container as environmental variable. Note that we chose the port 10000 for Xdebug, and PHPSTORM for IDE key. The docker-php-ext-enable xdebug creates the config file for Xdebug then, we throw the configuration for it to the file where is created. RUN echo "xdebug.remote_connect_back=Off" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.idekey=PHPSTORM" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_log=/var/log/xdebug_remote.log" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_port=10000" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

phpstorm debug php

RUN echo "xdebug.remote_mode=req" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_handler=dbgp" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

phpstorm debug php

RUN echo "xdebug.remote_autostart=true" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_enable=on" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini Creating the PHP containerįor creating the container, we will create a Dockerfile based on the official PHP image, in combination with Apache as web server and installing and enabling Xdebug.












Phpstorm debug php