10

How to open a project in PhpStorm from the command line on Windows?

I tried this: https://stackoverflow.com/questions/8304169/how-to-open-a-directory-in-phpstorm-or-intellij-or-any-jetbrains-ide-from-the][1] but can't find Tools -> Create command line launcher on Windows.

I am using the latest PhpStorm.

2
  • 1
    Does it work if you type "C:\Program Files\JetBrains\PhpStorm 2018.2\bin\phpstorm64.exe" "C:\PathToFolder"? Commented Aug 26, 2018 at 12:28
  • 1
    So far that launcher is implemented for Linux/Mac only. For Windows -- a bit of your time and you can do that yourself: stackoverflow.com/a/49455893/783119 Commented Aug 26, 2018 at 12:59

7 Answers 7

20

To open the current directory just run:

phpstorm64 .

If you are using git bash on Windows run:

cmd "/C phpstorm64 ."

Make sure that C:\Program Files\JetBrains\PhpStorm 2018.3.3\bin is in your environment variable PATH (it is by default after the installation)

Edit 2021:

  • Install Jetbrains Toolbox
  • Go to settings
  • Enable "Shell Scripts" and follow the instructions

enter image description here

Now you can use "phpstorm ." to open the current directory.

Sign up to request clarification or add additional context in comments.

1 Comment

Seems typo in phpstrom.
14

On macOS ( I assume on windows too) there is option to "Create Command-line Launcher". Just click that and you are good to go next time you open a terminal.

You can even specify how you would like to start "pstorm" / "phpstorm" / "ps" etc.. up to you.

enter image description here

Comments

7

Command-line launcher is currently only available fo UNIX; there is a feature request for providing it on Windows, IDEA-114307, please feel free to vote for it. If you like to start PhpStorm from command prompt, open cmd console, cd to %PS_install_dir%/bin and run either phpstorm64.exe or phpstorm.bat, passing a path to project folder to it, like it's described in https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html. If you like to start it from any directory, add %PS_install_dir%/bin to your system %PATH%

1 Comment

Too much hassle.
2

I know this is too late, but it will help others if they need it:

if you want to open phpStorm in the current directory via cmd/Powershell, just use this command:

phpstorm64.exe .

Or if you want to open it in another directory, just use:

phpstorm64.exe YOUR_DIRECTORY_PATH

Comments

1

as simple as that! go to your project using terminal

Cd myproject

and write phpstorm64.exe then hit enter

1 Comment

This won't work assuming phpstorm64.exe isn't in the project directory.
0

I see this is a little old but I wanted to supply my answer as I was grappling with this yesterday. My solution was to use cygwin.

Track down the phpstorm bin folder called something like C:\Users\UserName\AppData\Local\JetBrains\Toolbox\apps\PhpStorm\ch-0\201.7223.96\bin and add it to your windows system Path environment variable.

Next fire up a cygwin terminal and navigate into your project directory. I'm not a bash expert so I struggled to sort out the code as an alias but if you run:

crntproj=$(cygpath -w $PWD)

phpstorm.bat $crntproj

You need cygpath because simply running phpstorm.bat $PWD doesn't work as PHPStorm tries to open a folder called $PWD. I tried a bunch of variations trying to get it to open and none seemed to work.

It will fire up phpstorm with the current folder as the project path. And you now have a terminal feed from your project too.

Comments

0
  1. Add phpstorm path to the environment variables(system variables): C:\Users\user\AppData\Local\Programs\PhpStorm\bin : path of bin folder of php storm
  2. open terminal in specific folder where you want to open in php storm
  3. enter "phpstorm.cmd ."

That's it yay enjoy.

1 Comment

i tried every way but when i run the command as per description , there is one terminal which needs to be running . please try my solution you don't have to have a terminal session at all. kudos

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.