Skip to content

Launch PhpStorm from terminal like a standalone instance for mac OS

phpstorm

To run PhpStorm from the shell, use the open command with the following options:

  • -a: specify the application.

  • --args: specify additional arguments when passing more than just the file or directory to open.

  • -n: open a new instance of the application even if one is already running.

For example, you can run PhpStorm.app with the following command:

open -na "PhpStorm.app"

If PhpStorm is not in the default /Applications directory, specify the full path to it.

You can create a shell script with this command in a directory from your PATH environment variable. For example, create a file /usr/local/bin/phpstorm with the following contents:

#!/bin/sh

open -na "PhpStorm.app" --args "$@"

Make sure you have permission to execute the script. Give permission to execute phpstorm if needed

chmod 0755 /usr/local/bin/phpstorm

Now you should be able to run phpstorm from anywhere in the shell.

Leave a Reply

Your email address will not be published. Required fields are marked *

two × 3 =