Kenny Kenny - 1 year ago 254
PHP Question

PhpStorm "empty path to php" when setting up project through Composer

I am following along with a Laracast ( and when I try to set up a new Laravel project using Composer, as taught in the tutorial, I am unable to complete the dialog due to an error message stating "Empty path to php".

I have the path to PHP set properly, and am able to run and debug through PhpStorm. If someone can help me understand what's going on here, I'd appreciate it. I have searched Google and only found one result, which was for Windows, not Mac. (

Screenshot of what I'm seeing

Answer Source

As you can see from your screenshot the "New Composer Project" screen does not have any option to select the PHP Interpreter that is required to actually launch composer (that's how PhpStorm works -- the same approach for all supported OS: Linux, Mac and Windows).

The workaround is to choose default PHP Interpreter in Default Settings (settings that would be used for any future new project created on this machine) -- this way you will have PHP Interpreter already pre-selected even for this kind of new project.

You need to use File | Default Settings to set such default PHP Interpreter there (well, that's on Windows/Linux -- on Mac it could be at some different location in menu). If you do not have any projects opened you still can access such Default Settings from Welcome screen.

[UPDATE] Note: If you are still seeing same error after setting PHP Interpreter, then you'll need to restart PHP Storm and it will work like charm. (It worked for me)

In current versions (current 2016.1.x and upcoming 2016.2) you can specify what PHP Interpreter to use (and create new one, e.g. if you have none yet) at the bottom of this New Project screen -- it has Settings section which you can unfold -- just scroll the window down to see it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download