Home > front end >  Wrong php version in VS Code
Wrong php version in VS Code

Time:11-17

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 ?

CodePudding user response:

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.

CodePudding user response:

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.

  • Related