I have php 7 on my computer and I am working on a symfony project using docker with php 8.
My VSCode doesn’t recognize php version used in docker, it only recognizes php version installed on my computer.
How to fix it ?
Question posted in PHP Versions
You can find a list of all versions here.
You can find a list of all versions here.
2
Answers
You can install the Remote Containers extension. With that you can code directly on the container and thus use the PHP CLI version in your container.
Mind you: that cli version might differ also from the version that your webserver uses. So check that cli version on your container too.
So by default, VScode will use the target environment (your local machine) to pull information and develop against. If you want to use a development container for this (pros/cons for each). Then I would suggest you look over the https://code.visualstudio.com/docs/remote/containers page.
Essentially you will need both docker engine and the target environment container defined.