Skip to end of metadataGo to start of metadata
- PhpStorm Remote SSH External Tools with Docker Compose. Let’s be fancy and add some menu shortcuts with these commands. User preferences vary, but we can edit the menus in Appearance & Behavior like so. I’ve also added 16px-by-16px icons I found in one of the jars in the plugins folder.
- In this video I show you how to connect to and sync with remote hosts using PHPStorm. With PHPStorm you an connect via FTP, SFTP, FTPS and even a local serve.
PhpStorm detects the user home folder settings on the FTP/SFTP server and sets up the root path according to them. The button is only enabled when you have specified your credentials. FTP, FTPS, SFTP: Autodetect: Click this button to have PhpStorm detect the user home folder settings on the FTP/SFTP/FTPS server and set up the root path.
PHP Inspections | Bug | WI-58588 | False positive 'Condition is never matched' in match expression when one of inferred types of match argument is empty or mixed |
Plugin: Deployment _ FTP. | Bug | WI-57672 | Change help tooltip in deployment options |
Code Analysis. Duplicates | Bug | IDEA-255779 | Code duplicates in headless mode does not work in IntelliJ IDEA 2020.2.3 |
Core. IDE Settings | Feature | IDEA-247100 | Sync IDEA platform SDKs with those installed by asdf-java |
Bug | IDEA-255402 | 'Default project directory' setting is ignored | |
Core. Indexing | Bug | IDEA-259783 | shared-indexes: unload exception in JDKs |
Core. Installation | Exception | IDEA-257865 | CCE at com.intellij.database.actions.AddDataSourceFromPath$1.<init> |
Core. Navigation and Search | Bug | IDEA-259121 | 'Go to File' shows a lot of directories first but no files |
Core. Password Management | Bug | IDEA-258912 | OSX Keychain is not available on Apple ARM chips (aarch64) |
Core. Project Settings | Bug | IDEA-260248 | Project Structure dialog: changes in module name aren't applied if module dependencies were changed at the same time |
Bug | IDEA-262628 | Trusted host is not recognized if recorded with protocol | |
Bug | IDEA-260145 | Cannot rename module with custom (i.e. non project-default) JDK | |
Bug | IDEA-260512 | Android facets are gone | |
Bug | IDEA-249398 | Persistent AddDiffException on project open after quitting IDEA | |
Performance | IDEA-252694 | Freeze during processing changed project configuration files | |
Cosmetics | IDEA-263464 | The 'trust host' checkbox label in the Trust And Open Gradle/Maven Project dialog | |
Core. Run. Configurations | Bug | IDEA-261259 | Alternative coverage runner option disappears at reopening |
Bug | IDEA-256715 | 'Repeat N times' option in JUnit run configuration is shown twice | |
Bug | IDEA-256734 | Invalid got it tooltip for 'Repeat N times' | |
Bug | IDEA-259609 | '<no module>' can not be selected | |
Bug | IDEA-261930 | Run configuration's working directory disappeared after setting it to an empty value | |
Cosmetics | IDEA-260033 | [new run config UI] extra artifacts on 'Got it' tooltip | |
Core. Run. Targets | Bug | IDEA-258084 | Run Targets: JUnit: attempt to run 'all in package' run configuration fails with SSH target |
Editor. Diff and Merge | Bug | IDEA-257651 | Diff view detects big diff but change was only small |
Lang. Markdown | Bug | IDEA-258796 | Unnecessary backslash escape in triple-backticked bash block |
Lang. XPath and XSLT | Bug | IDEA-207408 | XSLT debugger broken on Java 9+ |
Tools. Docker | Bug | IDEA-259303 | Docker. Settings on the Tools page are wrong red marked |
Bug | IDEA-259400 | Log spamming by Docker integration when host is not available anymore | |
User Interface | Bug | IDEA-255506 | Inline debugger dialog incorrectly sized on Ubuntu |
Bug | IDEA-257834 | Cannot open cloned project while another one is being opened | |
User Interface. Embedded Browser (JCEF) | Bug | IDEA-259096 | JCEF: window.cefQuery_XXXXXX_XX is not a function for query created after the browser is shown |
User Interface. Focus | Bug | IDEA-259513 | Extra editor tab lose focus when switch between source/header |
User Interface. Graphics | Usability | IDEA-256044 | Close All But Pinned Broken / Missing |
Version Control | Bug | IDEA-169090 | Wrong highlighting of copy-pasted fragment in editor gutter |
Bug | IDEA-251317 | Viewing a diff from 'Apply Patch' dialog sometimes shows a weird error | |
Version Control. Git | Bug | IDEA-251265 | Search everywhere doesn't find action Annotate with Git Blame by request 'git blame' |
Bug | IDEA-253049 | Git Staging Area: 'Delete Files from Git' dialog shouldn't pop up on deleting unversioned files | |
Bug | IDEA-257461 | Missing arrows in stash camper window | |
Version Control. Log | Usability | IDEA-254354 | Branch list doesn't focus item on right click |
DB Introspection | Bug | DBE-12264 | Code: 417, e.displayText() = DB::Exception: Expected ANY or ALL in JOIN section, because setting (join_default_strictness) is empty, e.what() = DB::Exception |
Task | DBE-12513 | Error while introspecting H2 database: Syntax Error | |
DB Refactoring | Bug | DBE-12422 | Renaming MySQL JSON column with default value |
SQL Completion | Exception | DBE-12561 | Throwable at com.intellij.sql.psi.impl.SqlImplUtil.quoteIdentifier |
SQL Highlighting | Feature | DBE-12473 | Better highlighting in Run Configurations |
Feature | DBE-12470 | Support MariaDB Compound Statements outside of Stored Programs | |
Bug | DBE-12492 | Ambiguous column name isn't reported in qualified with CTE name | |
Bug | DBE-12371 | MariaDB SQL dialect: Incorrect handling of 'FOR SHARE' and 'RETURNING' | |
Bug | DBE-12493 | Incorrect syntax with min_active_rowversion | |
Bug | DBE-12528 | TODO comments ignored in procedure bodies for PostgreSQL | |
Bug | DBE-12499 | Can't pass multiple values in the ROWS FROM clause | |
Bug | DBE-12500 | Can't use type cast inside 'PARTITION OF' clause | |
Bug | DBE-12553 | Analytic functions are marked as error for H2 | |
HTML | Bug | WEB-36210 | Allow ARIA accessibility attributes in SVG elements |
Bug | WEB-49001 | Support data-* attribute in SVG 2.0 files | |
JavaScript | Bug | WEB-49156 | Incorrect syntax error 'yield is not allowed as identifier in strict mode' in a generator function |
Bug | WEB-49307 | Opening project in new version of IDE changes settings of JavaScriptSettings component in .idea/misc.xml | |
Performance | WEB-48983 | Webstorm 2020.3.x MacOS slow and high CPU compared to 2020.2 | |
Task | WEB-49259 | Show suggestions from string literals only on Ctrl-Space | |
JavaScript. Frameworks | Bug | WEB-48038 | No autocompletion for makeStyles/createStyles |
Bug | WEB-49137 | Quick fix 'Add import statement' doesn't work for 'React' | |
Bug | WEB-49135 | Incorrect import suggestions for React methods | |
Unit Tests | Bug | WEB-48569 | Error debugging Mocha tests run with Vue CLI due to 'Unknown argument: jobs' |
Bug | WEB-49314 | Cannot debug karma v6 test code (error in karma-intellij-debug.js) |
I'm changing my dev environment quite frequently, always looking for the current best option. While Windows with ddev was an ok option for TYPO3 development, since I'm doing Shopware including frontend development with lots of files in node-modules and corresponding file watchers, that setup has become too slow to comfortably work with. Now I finally found a setup based on Windows and WSL2 with Ubuntu that is a pleasure to work with, with all the benefits of having Linux as development environment seamlessly embedded into the Windows host system.
In this post I'm describing how to set all that up.
Goals:
- Usable PHPStorm with fast file sync
- Common development tools (git, ssh, tests) running
- No restarts, no dual-boot, no weird workarounds, no file mounts or nfs
- Running system.d, ssh agent and snap on Ubuntu
- Seamless integration into Windows
For example consider the following screenshot:
- Firefox is running on Windows
- Chromium is running on Linux
- The Windows Terminal App is running an Ubuntu Bash
- PHPStorm is running on Linux
1. Install WSL2 with Ubuntu 2020
First of all, you need to enable WSL2 and install Ubuntu. If you already have WSL2 enabled, get Ubuntu from the Microsoft store. Otherwise, find a tutorial here: https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10
2. Install x410 as display manager
To be able to seamlessly integrate Windows and Linux you will need a display manager / XServer. I use (and recommend) X410 (https://x410.dev/). It's currently available for less than 10 Euro in the Microsoft store and 'simply works'.
After installing X410, add the following line to your .bashrc
:
connecting your Ubuntu bash with the XServer.
If you want to get even more out of the XServer, check out the Cookbook on its website (https://x410.dev/cookbook/) - for example I added the XServer to the autostart.
3. Use keychain as ssh agent
Having an ssh agent available and loading your ssh key by default makes working with ssh or git much easier. To use your SSH key in Ubuntu, copy it to ~/.ssh/id_rsa
:
Then install keychain as SSH agent and manager:
To load the key automatically and start the agent, add the following line to your .bashrc
:
(of course, you can add / load other keys here, too)
More info or other ways to add SSH authentication can be found at https://medium.com/@pscheit/use-an-ssh-agent-in-wsl-with-your-ssh-setup-in-windows-10-41756755993e Wordpress 5.
4. Install Docker and enable WSL2 support
Current docker installations support WSL2 already. If you already have Docker installed, you can enable WSL2 integration, otherwise install it first. You can select the distributions where you want to use docker. After enabling, you might need to restart your WSL2 distribution to have it available.
5. Use 'systemd' hack to use snap (optional - be careful)
I wanted to be able to use snap for installing tools like node and PHPStorm - to make that possible, I needed to get systemd functional. There is no official support for running systemd on WSL2, however there are 'hacks' / 'workarounds' to make it work. Take a look before you leap and use with caution:
There may be other / updated ways to get it running at this point, keep an eye on https://github.com/microsoft/WSL/issues/5126
Once that's done, snap should be running:
6. Install PHPStorm with Snap
Now we are finally ready to install PHPStorm.
EAP:
Stable:
see also https://blog.jetbrains.com/phpstorm/2017/12/install-phpstorm-with-snaps/
Try starting PHPStorm by running phpstorm
in your terminal. As I'm lazy, I added the following alias to .bashrc
:
7. Install inotify for PHPStorm file watchers
PHPStorm will probably complain about file sync being slow when you start it - that's because we did not install inotify yet, which PHPStorm can utilize. To do so, type:
As the default amount of files a user can watch is pretty low - especially if you are doing anything frontend related ;) - you can increase that number by adding the following line in /etc/sysctl.conf
:
and applying the change:
For more info see https://blog.jetbrains.com/idea/2010/04/native-file-system-watcher-for-linux/
For debugging the file watcher see https://confluence.jetbrains.com/display/~roman.shevchenko/Debugging+native+file+system+watcher+for+Linux
Success!
You now have a running Ubuntu with PHPStorm incl. fast file sync.
-- Optional --
🐵 Random Stuff 🐵
The following section contains additional things I did to customize my environment and make it more fun to use - just in case someone is interested.
8. Install PHP / Composer / Node locally
As I'm doing quite a bit of development directly based on a local PHP server and nothing else, run Cypress acceptance tests via Node in PHPStorm etc. it's important for me to have my tools 'at hand' without the need to start or run a docker container.
Phpstorm Scp
I additionally installed PHP7.4 via apt (apt install php7.4-*
), composer via the recommended install script and node via snap install node
.
Phpstorm Sftp
9. Recommendation: Use Windows Terminal - with Emoji Support 🐱🐱🐱
As a terminal application I'm using the new Windows terminal - it's fast and has some nice features like tabs for different terminals (you can mix and mash Ubuntu and Powershell for example), colored tabs and - most important: EMOJIs!
Get it from the Windows Store: https://www.microsoft.com/de-de/p/windows-terminal-preview/9n8g5rfz9xk3
10. Customize your prompt and git environment (PS_1)
As you might have seen I'm a big fan of customizing your bash prompt and displaying git status information directly. To do that, I'm using the brew formula bash-git-prompt
. To install, first install linuxbrew and then tap the formula
See https://docs.brew.sh/Homebrew-on-Linux and https://formulae.brew.sh/formula/bash-git-prompt
11. Scaling issues
Depending on your system, you might have scaling issues when using Linux GUI Apps. In my case, adding the following to vars helped:
12. Install ddev on Ubuntu
I'd recommend installing and using ddev on Ubuntu, too - to install (if you installed linuxbrew in step 10):
See https://ddev.readthedocs.io/en/stable/#installation for more in-depth instructions.
13. Setup GPG TTY for signed commits
Phpstorm Split Window
When using Git with signed commits from Ubuntu you may need to set a TTY for GPG to allow unlocking your key.
Add the following line to your .bashrc
:
14. Bonus: Set keyboard layout to Dvorak on WSL2/X410
Phpstorm Scp Deployment
Some might know I'm using Dvorak as keyboard layout - to do so in Ubuntu GUI apps add the following to profile or .bashrc
:
Phpstorm Scratch File
That's it
I hope some of it is useful - if you have any questions or feedback let me know via Twitter (https://twitter.com/sasunegomo) or TYPO3 Slack (@susi)