LinuxCommandLibrary

phpstorm

Launch the PhpStorm integrated development environment

TLDR

Open a specific directory

$ phpstorm [path/to/directory]
copy

Open a file
$ phpstorm [path/to/file]
copy

Open a file at a specific line
$ phpstorm --line [line_number] [path/to/file]
copy

View the differences between two files
$ phpstorm diff [path/to/left_file] [path/to/right_file]
copy

SYNOPSIS

phpstorm [OPTIONS] [PATH]
phpstorm [OPTIONS] FILE[:LINE[:COLUMN]]
phpstorm --diff PATH1 PATH2

PARAMETERS

[PATH] or .
    Opens a project located at PATH or the current directory ('.').

FILE[:LINE[:COLUMN]]
    Opens a specific file, optionally navigating to a specific line and column within that file.

--help, -h
    Displays a help message with available command-line options.

--version
    Prints the PhpStorm version information.

--diff
    Opens a file comparison window for the two specified files or directories.

--line
    Used with FILE to specify the line number to open. Requires a file path argument.

--column
    Used with FILE and --line to specify the column number to open. Requires a file path and line number.

--wait
    Keeps the shell process running until the IDE is closed. Useful for integration with external tools (e.g., Git hooks).

--temp-project
    Opens the specified directory as a temporary project, without adding it to the recent projects list.

--project
    Opens the IDE with a specific .ipr or .idea project file located at PATH.

--args
    Passes arguments directly to the Java Virtual Machine (JVM) that runs PhpStorm. For advanced use cases.

--disable-plugin
    Disables a specific plugin by its ID upon startup.

--settings
    Specifies an alternative path to the IDE's settings directory for portable or specialized configurations.

DESCRIPTION

The phpstorm command is the primary entry point for launching the JetBrains PhpStorm integrated development environment (IDE) on Linux. PhpStorm is a powerful, cross-platform IDE specifically designed for PHP and web development. It provides intelligent code completion, on-the-fly error checking, debugging, refactoring tools, version control integration, and support for various web technologies like HTML, CSS, JavaScript, TypeScript, and popular frameworks.

When executed without arguments, phpstorm typically opens the IDE to the last opened project or the welcome screen. Users can specify paths to projects, files, or directories to open them directly within the IDE. The command also supports various options to control IDE behavior, such as opening files at specific lines, performing diff operations, or waiting for the IDE to close before returning control to the terminal. It's often located in /usr/local/bin or within the installation directory's bin subdirectory, and its availability depends on whether PhpStorm has been installed and its executable linked to the system's PATH.

CAVEATS

GUI Requirement: PhpStorm is a graphical application; thus, running the phpstorm command requires an active graphical user interface (GUI) environment. It cannot be run purely from a command-line interface without display capabilities.
Installation Path: The phpstorm command must be accessible in your system's PATH environment variable. If not, you might need to execute it from its installation directory (e.g., /opt/PhpStorm/bin/phpstorm.sh) or create a symbolic link.
Resource Intensive: As a full-featured IDE, PhpStorm can be resource-intensive, requiring significant RAM and CPU, especially for large projects.
Licensing: PhpStorm is a commercial product and requires a valid license after a trial period.

CONFIGURATION DIRECTORY

PhpStorm stores its configuration, caches, and logs in specific directories, typically under ~/.config/JetBrains/PhpStorm<version> and ~/.cache/JetBrains/PhpStorm<version> on Linux. These directories can sometimes be useful for troubleshooting or resetting IDE settings.

SHELL SCRIPT WRAPPER

The phpstorm command on Linux is often a shell script (e.g., phpstorm.sh) located in the bin subdirectory of the installation. This script sets up the Java environment and launches the actual Java application, allowing for environment variable manipulation before launching the IDE.

JETBRAINS TOOLBOX APP

JetBrains provides a 'Toolbox App' for managing and updating its IDEs. When installed via Toolbox, the command-line launchers for IDEs like PhpStorm are typically managed automatically and placed in a convenient location in the user's PATH, simplifying setup and updates.

HISTORY

PhpStorm is developed by JetBrains, a Czech software development company. The first public release of PhpStorm was in 2009. It was built on top of the IntelliJ IDEA platform, which itself was first released in 2001. This lineage means PhpStorm benefits from a mature and robust IDE architecture, sharing many core features, user interface elements, and plugin capabilities with other JetBrains IDEs. Its development has continuously focused on deep understanding of PHP language features, frameworks, and web technologies, evolving alongside the PHP ecosystem to provide cutting-edge development tools. The command-line interface has been a consistent feature across JetBrains IDEs, allowing for integration with various developer workflows and external tools.

SEE ALSO

webstorm(1), idea(1), pycharm(1), code(1), vim(1), emacs(1)

Copied to clipboard