简体   繁体   中英

Intellij Project Structure: Configure PHP SDK

starting with Intellij 13.1 which was released today, it is possible to configure additional SDKs in the Project Structure dialoge. While the old 13.0 version only contained the following three items when clicking on the new button:

  • JDK
  • IntelliJ Platform Plugin SDK
  • Mobile SDK

The new 13.1 update has added several more options as can be seen on the screenshot: 在此输入图像描述

When I click on PHP Interpreter then a directory chooser opens and ask me for the "Select Home Directory for PHP Interpreter". Which folder is the correct one under Ubuntu?

I have tried /usr/bin and I get a message that says: Probably SDK installed in '/usr/bin' is corrupt , and when I choose another directory then the message says: The selected directory is not a valid home for PHP Interpretor . 在此输入图像描述

However, when I go to Settings->PHP I have already correcly configured PHP 5.4 and when I open the details by clicking on '...' then I see the following:

在此输入图像描述

Has anyone tried this? Am I doing something wrong, or is this a bug in IntelliJ maybe?

Open a new local shell/terminal window and type which php this will tell you where the php binary is installed

in some ubuntu releases the repo's install php as php5, if that is the case you might need an ln -s to php

Although in my PhpStorm (PS-138.2071) it looks like this : 在此输入图像描述

This is done on settings level. Don't do it in project sdk level. Got to settings, look for php. Choose PHP language level and intellij will scan and get the interpreter for you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM