skip to Main Content

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 ?

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search