Install phpstorm
A third option is the Projector app, which runs PhpStorm on WSL2 (or anywhere else) but displays it in a browser.) Basics ¶ (JetBrains is really working to catch up with the slick WSL2 support of vscode. We’ll walk through both of these approaches.
INSTALL PHPSTORM WINDOWS
PHPStorm works fine this way, but it’s yet another complexity to manage and requires enabling X11 (easy) on your Windows system.
INSTALL PHPSTORM FULL
In the main PHP setup dialog, add an entry to the path mappings, as it doesn't correctly derive the full path mapping.Due to a PhpStorm bug you'll want to put the full name of the binary, like php8.0 if you're not using the default version. In the PHP Interpreter path, you can just put php if you're using the default PHP version (currently 7.4). In the CLI interpreter "Lifecycle" select "Connect to existing container"ĩ. You'll need to rename your project to get these instructions to work.)Ĩ. (Note that DDEV project names that contain dots do not currently work due to a PhpStorm bug. Add an environment variable COMPOSE_PROJECT_NAME=ddev. , (Command+Shift+Dot) to show hidden dotfiles.ħ. So "Virtual Machine Path" would be "/var/Now back in the "Configure Remote PHP Interpreter" for "Configuration files" use. In the "Path mappings" of the "Server" you may have to map the local paths (which on WSL2 means /home/.) to the in-container paths, especially if you have mutagen enabled. Choose "Docker for Windows" or "Docker for Mac"Ĥ. Create a server the default name is "docker", but since the "server" for each project will be different, name it for the project, for example "DDEV d9". Use the "+" to select "From Docker, Vagrant, VM."ģ. Under File→Settings→PHP (Windows) or Preferences→PHP (macOS), click the "." to the right of "CLI Interpreter"ġ.(All you have to do here is click the little telephone to "Start listening for PHP Debug Connections", then ddev xdebug on, then visit a web page and choose the correct mapping from host to server. This will result in a PhpStorm "Server" with the proper name, normally the same as the FQDN of the project. Set up your project to do normal Xdebug, as described in the Step Debugging section.(If you're running PhpStorm inside WSL2, there are no special instructions.) In other words, in the "Open" dialog, browse to \\wsl$\Ubuntu\home\rfay\workspace\d9 (in this example). If you're on Windows, running PhpStorm on the Windows side but using WSL2 for your DDEV project, open the project as a WSL2 project. In this example, the project name is "d9" and the site is "d9.ddev.site". WSL2 instructions are provided where necessary. Any OS platform, but if you're using Windows PhpStorm with WSL2 the path mappings are slightly more complex.If this is still a problem, you can ddev config global -required-docker-compose-version=v1.29.2 to globally require docker-compose v1. Due to a bug or two in PhpStorm, it can't properly interpret docker-compose v2 output as of Sept 2021. You may need to add the PHP Docker plugin.You'll end up with PhpStorm actually using the PHP interpreter inside the ddev-webserver container of your project, and able to use composer and phpunit inside there as well. It works on macOS, Linux, Windows with WSL2 and Windows traditional. This is based on the wonderful article by Susanne Moog, and couldn't have been done without it, but since PhpStorm has fixed some things and DDEV has worked around others, this is far easier now. It works on all OS platforms, including macOS and WSL2.
INSTALL PHPSTORM HOW TO
This explores how to add full PhpStorm integration with a DDEV project, including composer and phpunit.
PhpStorm Integration PhpStorm Configuration and Integration ¶ Full Integration with Docker, DDEV, and PhpStorm ¶
Sharing a project with `ddev share` or by exposing a port Full Integration with Docker, DDEV, and PhpStorm