0

When using the System PHP interpreter for PHPStan, I get an error that the PHP version mismatches with the one being used in the Docker, see picture.

enter image description here

But when I set PHPStan to use the PHP interpreter inside the Docker container, I get an error "input device is not a TTY".

enter image description here

Anyone got any ideas how to get this running? Here's the rest of the config:

enter image description here enter image description here

2
  • 1
    Check youtrack.jetbrains.com/issue/WI-71289 1) Try switching the Docker Compose v2 option ON; 2) or add this environment variable to the PHP Interpreter : COMPOSE_INTERACTIVE_NO_CLI=1 Commented Apr 26, 2023 at 8:12
  • Thanks, the environment var fixed it..if you want you can answer and I'll accept it as solution. Commented Apr 26, 2023 at 9:30

1 Answer 1

0

Speaking in general (from the docker-compose exec docs):

Commands are by default allocating a TTY, so you can use a command such as docker-compose exec web sh to get an interactive prompt.

To disable this behavior, you and JetBrains/PhpStorm devs could use -T flag to disable pseudo-tty allocation when executing the command, i.e.:

docker-compose exec -T web php /path/to/some/file.php

Or set the COMPOSE_INTERACTIVE_NO_CLI environment variable to 1 before running docker-compose exec:

export COMPOSE_INTERACTIVE_NO_CLI=1

In case of PHP Interpreter configuration in PhpStorm (since you do not execute that command yourself), you can set that env variable in the PHP Interpreter settings:

enter image description here
(the screenshot is take from this comment)

Here is PhpStorm ticket to watch after (star/vote/comment) to get notified with any progress: https://youtrack.jetbrains.com/issue/WI-71289

Another option to try:

I updated my docker and switched from using docker-compose to the docker compose plugin (by checking "Use Compose V2" under "Settings/Preferences | Build, Execution, Deployment | Docker | Tools"), and now it works, so it might be a docker-compose specific problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.