2

DDEV/PhpStorm - invalid ddev-docker-compose-full.yaml

I'm trying to setup PhpStorm CLI interpreter and face this...

I found that PhpStorm has/had problems with docker-compose2, but did not find a solution.

enter image description here

ddev version

 ITEM             VALUE                                   
 DDEV version     v1.21.6                                 
 architecture     amd64                                   
 db               drud/ddev-dbserver-mariadb-10.4:v1.21.5 
 dba              phpmyadmin:5                            
 ddev-ssh-agent   drud/ddev-ssh-agent:v1.21.5             
 docker           23.0.6                                  
 docker-compose   v2.15.1                                 
 docker-platform  sr-VirtualBox                           
 mutagen          0.16.0                                  
 os               linux                                   
 router           drud/ddev-router:v1.21.5                
 web              drud/ddev-webserver:v1.21.5  
LazyOne
  • 158,824
  • 45
  • 388
  • 391
sv3n
  • 319
  • 4
  • 17
  • Do you have current phpstorm? There was a problem like this a year or two ago with phpstorm. – rfay May 30 '23 at 18:43
  • @rfay yes. updated today. its 2022.2.5 – sv3n May 30 '23 at 20:15
  • 2
    @sv3n Try the latest, which is **2023.1.2** – LazyOne May 30 '23 at 21:18
  • @LazyOne on 2013.1.2 now nothing changed :/ – sv3n May 30 '23 at 21:33
  • 1
    What happens if you run `docker compose -f .ddev/.ddev-docker-compose-full.yaml config` in the project root? – Eugene Morozov May 31 '23 at 14:12
  • @EugeneMorozov it shows the config. No errors. – sv3n May 31 '23 at 14:19
  • 1
    Just noting that I am seeing this same error, using 2023.2 EAP – Mrweiner May 31 '23 at 17:33
  • @EugeneMorozov: It looks like that Phpstorm uses docker compose V1 (`docker-compose`) while the file is compatible with docker compose V2 (`docker compose` w/o the dash)? Perhaps there is a setting to specify which command to use? – hakre Jun 01 '23 at 05:37
  • @hakre you're right. Can you post it as answer? There is a checkbox to use v2 in Settings - Build, ... - Docker - Tools. – sv3n Jun 01 '23 at 16:49
  • @sv3n: Can you do me a little favor and reproduce the error message and copy & paste it as well into the question? this would be great for using ddev + phpstorm (and sure, good old magerun!) – hakre Jun 01 '23 at 17:30
  • @hakre of course. Will add it later. – sv3n Jun 01 '23 at 18:26
  • People all over the workld are using PhpStorm successfully with DDEV. I suspect you're still using an older version of PhpStorm, but it's hard to help you unless you post the actual .ddev/.ddev-docker-compose-full.yaml (preferably as a gist on gist.github.com). Please see https://ddev.readthedocs.io/en/latest/users/install/phpstorm/ and please use the PhpStorm plugin. – rfay Jun 05 '23 at 02:15
  • 1
    @rfay it’s solved. There’s an option in phpstorm to use v2. – sv3n Jun 05 '23 at 17:11
  • Please review https://ddev.readthedocs.io/en/latest/users/install/phpstorm/ and see if there's something that could be improved there to solve this for others... – rfay Jun 08 '23 at 22:35
  • 1
    @rfay: apropos improvements to the docs, if I may highlight the patch that came out of this exact Q&A here on SO: [0001-Ddev-apt-dpkg-certificate-location.patch](https://gist.github.com/hakre/29735e64ed5746664857a2c14180c0a0#file-0001-ddev-apt-dpkg-certificate-location-patch) - naturally reported as an issue days ago: https://github.com/ddev/ddev/issues/4960 -- to quote [_"@rfay it's solved"_](https://stackoverflow.com/questions/76366191/ddev-phpstorm-invalid-ddev-docker-compose-full-yaml/76384209#comment134734381_76366191), +1 – hakre Jun 09 '23 at 22:53

1 Answers1

2

It looks like that Phpstorm uses docker compose V1 (docker-compose) while the file is compatible with docker compose V2 (docker compose w/o the dash)?

Perhaps there is a setting to specify which command to use?

And sv3n comments:

There is a checkbox to use v2 in Settings - Build, ... - Docker - Tools.

Activate Docker Compose v2 in Phpstorm Settings (Phpstorm 2023.1.2)

(Activate Docker Compose v2 in Phpstorm Settings (Phpstorm 2023.1.2) for ddev development)

hakre
  • 193,403
  • 52
  • 435
  • 836