Archive for

November, 2012


Open files from the command line in PHPStorm

1 comment

I’m a big terminal fan, and I’m also a PHP developer.  Last month, I switched from Netbeans to PHPStorm for a full-fledged PHP IDE1.  Often, I’m in the terminal, and find it natural to open a file in PHPStorm from there.  Awkwardly, you need to use the full path of the file to do this.  That means, if I’m in /var/www/some_client/some_site/htdocs/resources/web/ I have to type this command just to open index.php in that directory:

phpstorm /var/www/some_client/some_site/htdocs/resources/web/index.php

Ugh. Far too much typing. I looked for a shell integration plugin, or a setting under File -> Settings, where PHP Storm crams thousands of options.2

It turns out, I was just looking in the wrong place. You have to set up this feature, but it’s dead simple. Open Tools -> Create Command-Line Launcher….

PHP Storm Command Line setup menu option

Next, pick a name for the executable and a path to place the shortcut in.  The name is the command you’ll type to run phpstorm from the terminal, so you can make it shorter for even less typing!  The path should be in your system shell’s $PATH variable; PHPStorm’s default is probably what you want if you don’t know what this means.

PHP Storm Command Line Config dialog

PHP Storm Command Line Config dialog

Hit OK to save.  If your user doesn’t have acces to that Path, you may be prompted to enter a password for the system root user.

Once you’re done, you can navigate into any directory and run your command to open files directly in PHP Storm.

pstorm somefile.php

Your life will be 30% better from now on.

  1. mostly on account of IdeaVIM’s excellent VIM emulation.  It’s not complete, but netbeans’ version is vastly inferior.
  2. For a while, I resorted to a slightly shorter workaround, typing “phpstorm `pwd`/index.php” in these situations… still too much typing

SDCC2012 Talk: Building Modern PHP Applications

no comments

I gave a talk over at South Dakota Code Camp 2012 this morning on building modern PHP applications.

I tried to cover some of the traditional problems, recent solutions, new features, and new tools in PHP. It’s an exciting time in the language, so there was a lot to squeeze in. I talked briefly about one of the best new PHP frameworks, Symfony2, and how it is utilizing new PHP features and culture to help improve applications.

Here are the slides; hopefully they’re still useful.

Please provide feedback if you saw the talk (not just the slides, some are more of a joke).

The talk covered a lot — probably too much.  Here some links to help you get the rest of the story on some of the many things we zoomed past:

  • For standards-nerds, don’t miss
  • Composer was one of the most awesome tools discussed.  You can find it at, and you can find a great repository of Composer packages at
  • We talked about Symfony.  You should visit to find out more about their great framework.  They’ve got excellent doc that will walk you through the things we raced through in the talk.
  • Also, every PHP developer should take a peek at PHPTheRightWay