PhpStorm 2021.2 Help

PhpStorm Workshop Materials

The PhpStorm workshop materials will guide you through many of the PhpStorm features and productivity tools. They do not cover every possible option and feature in PhpStorm. Instead, they provide a number of practical exercises to enhance your everyday workflow as a PHP developer.

Here's a 5-minute screencast outlining the Workshop materials:

Prerequisites

To complete the workshop materials, you will need PhpStorm 2016.1 or later installed on your system, either the full version or a free trial. Many things will work with earlier versions too, but to do everything in these materials version, 2016.1 or later is recommended.

A git command line will be great to have as well.

Exercises

PhpStorm Workshop exercises come as a PhpStorm project, in which every file is a new exercise that may contain code and tips to get things done. There are exercises on navigation, editing, inspections, live templates, refactoring, tools like Composer and HTTP client, and other areas.

The workshop is self-paced, meaning you can work your way through exercises on your own, whenever and wherever you want.

Keyboard shortcuts

We'll cover multiple keyboard shortcuts available in PhpStorm. Other IntelliJ IDEA-based IDEs use the same keyboard shortcuts, so if you know how to work with PhpStorm, you'll know how to work with WebStorm, RubyMine, PyCharm, and IntelliJ IDEA, and vice versa. A cheat sheet is available online and is also included in the workshop download.

Getting the workshop materials

  1. On the PhpStorm Welcome screen, click New Project.

    ps_quick_start_welcome_screen_mac.png
  2. Select PhpStorm Workshop Project from the list on the left, provide the project location in the Location field, and click Create.

    Create workshop project from New Project dialog.png

Exploring the project

The project contains folders and files including one or more exercises. Most exercises are self-contained, but some build on previous ones.

ps_workshop_materials_explore_the_project.png

The project root includes several other files as well:

  • Readme.md contains additional information about PhpStorm Workshop.

  • PhpStorm Reference Card.pdf is the PhpStorm keymap. The latest version can always be found on the

    PhpStorm website.

Running Docker

The Workshop project contains a pre-configured Docker environment. Most exercises that are not related to the editor require having Docker containers running.

  1. Install Docker for your operating system.

  2. In PhpStorm, in the Settings/Preferences dialog Ctrl+Alt+S, go to Build, Execution, Deployment | Docker and select how to connect to the Docker daemon.

    Depending on your operating system, do the following:

    • Select TCP socket.

    • Set Engine API URL to tcp://localhost:2375.

    • Leave the Certificates folder field empty.

    If you are using Docker Toolbox, use the following configuration options instead:

    • Set Engine API URL to https://192.168.99.100:2376

    • Set Certificates folder to <your_home_directory>\.docker\machine\machines\default.

    • Select Docker for Mac.

    • Select Unix socket.

  3. Open docker-compose.yml in the editor and update the XDEBUG_CONFIG variable with the value depending on your operating system. This is necessary for Web Debugging.

    Use the host.docker.internal value, which refers to the remote host, that is, the machine Docker is running on. It will automatically resolve to the internal address of the host, letting you connect to it from the container.

    The corresponding part of the docker-compose.yml file should look as follows:

    XDEBUG_CONFIG: remote_host=host.docker.internal

    Use the host.docker.internal value, which refers to the remote host, that is, the machine Docker is running on. It will automatically resolve to the internal address of the host, letting you connect to it from the container.

    The corresponding part of the docker-compose.yml file should look as follows:

    XDEBUG_CONFIG: remote_host=host.docker.internal

    Use your local machine’s hostname. To obtain it, execute the hostname command in Terminal.

    The corresponding part of the docker-compose.yml file should look as follows:

    XDEBUG_CONFIG: remote_host=<local_hostname>
  4. In the same docker-compose.yml file, uncomment the appropriate line for the sftp service depending on your operating system. This is necessary for deployment to work correctly.

  5. Click Start services button in the editor gutter to start all required Docker containers.

    Start containers button

    Alternatively, open the built-in PhpStorm Terminal (Alt+F12) and execute the docker-compose up command.

Feedback and pull requests

If you find an error and know what is wrong, feel free to fix it and send a pull request. If you discover an interesting PhpStorm feature that is not covered, fork our GitHub repository, add your content, and send us a pull request.

Your feedback is welcome via issues on GitHub.

Last modified: 20 October 2021