How to use containner / toolbox in phpstorm?


I have a situation I can’t solve.

I installed fedora silverblue 30 with upgrade to 31. I created a container using toolbox and in that container was installed php 7.3 and componser. How can I use this container’s php in phpstorm setup?

I didn’t use PHPStorm in particular, but I have a similar setup in VSCode (for golang):

  • Create a new script ~/.local/bin/php with contents:
    toolbox run php
  • Make sure PHPStorm has ~/.local/bin/ in PATH and it earlier than other php binaries in your system

This would make the app run ~/.local/bin/php, which is in fact running a command in a toolbox container

I tried to make the script but it didn’t work because php storm when running php it for some parameters.
Example: php -S localhost: 8080 -t “/ public” “server.php”
If I execute using the script the parameter is not accepted.
Could you pass print / config you use in vscode?