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

I follow along with Laracast ( https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/21?autoplay ) and when I try to create a new Laravel project using Composer, as I taught in In the tutorial, I cannot complete the dialog due to the error message "Empty path to php".

I have the correct path to PHP that I can run and debug through PhpStorm. If someone can help me understand what is happening here, I would appreciate it. I searched Google and found only one result that was for Windows, not for Mac. ( https://devnet.jetbrains.com/thread/475384 )

Screenshot of what I see

+7
php phpstorm
source share
1 answer

As you can see in the screenshot, on the “New Composer Project” screen there is no way to select the PHP interpreter that is needed to actually run the composer (how PhpStorm works - the same approach for all supported OS: Linux, Mac and Windows).

The workaround is to choose a standard PHP interpreter in the default settings (the parameters that will be used for any future new project created on this computer) - this way you will have a PHP interpreter already pre-selected even for such a new project.

You need to use File | Default Settings File | Default Settings to set such a default PHP interpreter (well, that on Windows / Linux - on a Mac it may be elsewhere in the menu). If you do not have open projects, you can still access these default settings on the welcome screen.

Note. If you still see the same error after installing PHP Interpreter, try restarting PhpStorm - should help.


Note In the current version of 2016.x, you can also specify which PHP interpreter to use (and create a new one if necessary) at the bottom of the “New Project” screen - it has a Settings section that you can expand - just scroll down to see it.

+10
source share

All Articles