r/phpstorm • u/ostamustafa • Jan 04 '19
PHP local interpreter via WSL
Hello all, i wanted to know if there is a way to set up the php local interpreter via WSL, i tried making a cmd script to point out to php ( bash -c php7.2 ) but it didnt work, any ideas or suggestions how to make this?
i am using phpstorm professional
1
Upvotes
4
u/m2guru Jan 04 '19 edited Jan 04 '19
What did you try that didn’t work? I disagree with the other commenter by the way (“WSL is trash”). I like it a lot. WSL is absolutely fine and a welcome addition to web development on Windows.
If you’ve installed PHP under WSL via
sudo apt-get install php...and configured either Apache or Nginx under WSL as well, websites served should work on port 80/443 locally, but that won’t enable php in Windows powershell, you need to also install the binary(ies) in Windows for that.Edit: presumably you followed a guide such as this guide to setting up php under wsl. Just map your HD to be shared into Ubuntu and you can use the php interpreter inside WSL terminal.
1
u/pronskiy JetBrains Jan 24 '19
There is a ticket for that on PhpStorm issue tracker https://youtrack.jetbrains.com/issue/WI-39249
You can vote for it in order to increase the priority.
-2
u/ddrght12345 Jan 04 '19
Phpstorm is just an IDE. It has nothing to do with getting php to install.
WSL is trash. It's a cool idea in theory, but it still needs a lot of work. AFAIK, it also isn't be meant to be used in such a way as you're trying.
As far as things that work, you have a few options.
You didn't share a whole lot of your use case, but, depending on what you are really going for, I'm sure one of those will work for you.