8

I am following along with a Laracast (https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/21?autoplay) 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. (https://devnet.jetbrains.com/thread/475384)

Screenshot of what I'm seeing

5
  • Ok... so signing my name is not needed? lol Commented Feb 11, 2016 at 18:01
  • Do you have any projects already created in PhpStorm? If so -- please make sure that File | Default Settings (I hope it is present for Mac as well, if not -- search for "Default Settings" or maybe "Default Preferences" in menu) has some PHP Interpreter defined and selected already. Commented Feb 11, 2016 at 18:02
  • "Ok... so signing my name is not needed?" If someone wants to know more about you he/she can check your profile (where you can enter your real name). Commented Feb 11, 2016 at 18:03
  • Cool - thanks for explaining why signing is not needed. I'll keep that in mind. Just a habit from email I guess. Commented Feb 11, 2016 at 18:05
  • Thanks LazyOne - that did the trick. If you want to put it as the answer, I'll mark it as the accepted one. Commented Feb 11, 2016 at 18:06

1 Answer 1

11

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.

Note: If you are still seeing same error after setting PHP Interpreter, then try restarting PhpStorm -- should help.


Note that In current 2016.x versions you can also specify what PHP Interpreter to use (and create new one if needed) at the bottom of this New Project screen -- it has Settings section which you can unfold -- just scroll the window down a bit to see it.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for the clear answer. I didn't know about File | Default Settings - but I do now! :o)
Another issue I ran into: using PHP7 as interpreter somehow also triggers the empty path to PHP error. Setting it to PHP5.5 fixed it for me.
i"ve the same issue. With php7 it doesn't recognize the interpreter by default.
It wasn't initially working for me with PHP7. After restarting PHPStorm (still set to PHP7) it did work for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.