The debugging itself works, but the Web Server Debug Validation (Run > Web Server Debug Validation) does not properly work, and I do not understand why. My setup of xdebug for my coker container can be summed up pretty much with this here.
And my docker configurations are:
RUN pecl install xdebug \
&& apt update \
&& apt install libzip-dev -y \
&& docker-php-ext-enable xdebug \
&& a2enmod rewrite \
&& docker-php-ext-install zip \
&& rm -rf /var/lib/apt/lists/*
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY composer.json .
RUN groupadd -r user && useradd -r -g user user
RUN composer install --no-dev
COPY . .
# Source code
# unbind local composer components
The folder structure is:
If I now launch
I can successfully load the contents at http:localhost, or also at http:localhost:80. 200, Everything's fine.
When I click on "start listening for debugging connections" within the IDE; I can also successfully start the configured step debuggings, all of that works. Now I have two questions:
- When I go to Run > Web Server Debug Validation, and then select "Local Web Server orShared Folder", then type "C:\Users\....project_abc_root" as the value of "Path to create validation script", and "http://localhost:80" as the value of "URL to validation script", I always get: "Specified URL is not reachable, caused by: 'Request failed with status code 404'". Why? Same if I specify "C:\Users\....project_abc_root\php" as the value of "Path to create validation script". I've read this documentation of yours, and now countless other forum posts etc etc, and I can't really figure out why. I've also not set any kind of redirects. I also totally do not understand where you actually define path mappings that are used when ticking the option "Local Web Server orShared Folder"; there's no reference in the GUI whatsoever??
- As you can see from my file structure, regarding composer parts, I aim to only use composer.json in my project, while completely omitting the other composer components (vendor, composer.phar and composer.lock) within the project. The goal is to only load them within the running container, to not need to place them in repositories as well. When I however trigger the step debugger, as soon as I step into classes that are loaded via the autoloader, I get stuff like "Cannot find a local copy of the file on server /var/ww/html/vendor/composer/ClassLoader.php". This makes total sense, as I have no vendor folder present in the local project. Can youhowever, within IntelliJs IDE, somehow coordinate with xdebug that it takes the files for the step debugging directly from source, like the vendor folder, only present there? Or would I need to manually install composer and download the packages to be able to fully debug the application locally? I'm really confused by how you define your mappings for the debuggings, hence my question. There is Languages & Frameworks > PHP > Servers that you can use to define Servers with path mappings, then there is also Build, Execution, Deployment > Deployment where you can define Deployment instances + concerned path mappings, but it's not clear to me if and in which measure these settings are used in debuggings??
These are my two questions, thanks in advance for your help!