phpStorm failed to run Codeception remote using Docker
I am trying to debug a Codeception test but I am unable since it fails with the following error:
[docker://drm-docker_client-apache:latest/]:php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=host.docker.internal /opt/.phpstorm_helpers/codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi --no-interaction -c /var/www/drm-client/codeception.yml tests/api/ClientCest.php
Could not open input file: /opt/.phpstorm_helpers/codeception.php
Process finished with exit code 1
Here is how I have setup the Test Framework:

A `docker container ls` will shown the phpstorm_helpers container created but not running:
λ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f69142284830 e06ebb619315 "/bin/sh" About a minute ago Created phpstorm_helpers_PS-191.7479.51
5d0ed558c02d docker_client-apache "docker-php-entrypoi…" 2 minutes ago Up 2 minutes 0.0.0.0:8004->80/tcp client
340a923625b7 mysql/mysql-server:5.7 "/entrypoint.sh mysq…" 2 minutes ago Up 2 minutes (healthy) 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
What I am missing here?
Please sign in to leave a comment.
We had a similar report recently, please check if following my advices posted here helps:
https://youtrack.jetbrains.com/issue/WI-46094#focus=streamItem-27-3403979.0-0
@Eugene apparently this issue is fixed on the latest phpStorm 2019.2 since it's gone now. However I am getting the following:
My setup for Codeception looks as follow:
And this is the content of the xdebug.ini file:
What I am missing here? Is there any other config I have to do at phpStorm level?
Anyone find a solution? I have the same problem with the last version of PHPStorm. I am using the selenium/standalone-chrome-debug:latest image.
Versions:
Configurations:
Docker
Server:
Interpreter:
Run/Debug:
Error on run a suite:
Am I mistake something? There are any aditional configuration?
Mstrey, it complains that the file is not there, which probably means that the volumes mappings are either wrong or absent.
Could you please also share a screenshot of Settings | PHP?
reynierpm, I must have missed your comment, sorry. You probably got it sorted out a while ago, but in general, this error means that the Docker network the container runs in doesn't have the other services attached, probably because you had docker-compose run rather than docker-compose exec mode used.
Eugene Morozov this is my settings | PHP.
this is my docker-compose.yml:
Any suggestion?
Eugene Morozov
I'v tried another aproach. I create a new docker configuration:
And then a new interpreter with this configuration:
Finaly I change the interpreter in my Run/Debug:
but the error changed:
despite that, the tests are running without problem directly inside de docker container:
I finally solved the mistery!!
1) In the Test Framework configuration the path to codeception need to be the full path /usr/src/myapp/vendor/codeception/codeception/codecept. PHPStorm canot support the alias /usr/src/myapp/vendor/bin/codecept
2) In the .env file we never can use localhost or 127.0.0.1. all references need to be to host.docker.internal.
Now all integration between PHPStorm and docker are sucessfully running
Eugene Morozov tks for your help.