简体   繁体   English

Intellij项目结构:配置PHP SDK

[英]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. 从今天发布的Intellij 13.1开始,可以在Project Structure dialoge中配置其他SDK。 While the old 13.0 version only contained the following three items when clicking on the new button: 虽然旧的13.0版本在单击新按钮时仅包含以下三个项目:

  • JDK JDK
  • IntelliJ Platform Plugin SDK IntelliJ平台插件SDK
  • Mobile SDK 移动SDK

The new 13.1 update has added several more options as can be seen on the screenshot: 新的13.1更新增加了几个选项,如屏幕截图所示: 在此输入图像描述

When I click on PHP Interpreter then a directory chooser opens and ask me for the "Select Home Directory for PHP Interpreter". 当我点击PHP Interpreter然后打开目录选择器并询问我“选择PHP解释器的主目录”。 Which folder is the correct one under Ubuntu? 在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 . 我已经尝试过/usr/bin并且收到一条消息: 可能是'/ usr / bin'中安装的SDK已损坏 ,当我选择另一个目录时,消息显示: 所选目录不是PHP解释器的有效主页 在此输入图像描述

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: 但是,当我转到Settings-> PHP时,我已经正确配置了PHP 5.4,当我通过点击'...'打开详细信息时,我看到以下内容:

在此输入图像描述

Has anyone tried this? 有没人试过这个? Am I doing something wrong, or is this a bug in IntelliJ maybe? 我做错了什么,或者这可能是IntelliJ中的一个错误?

Open a new local shell/terminal window and type which php this will tell you where the php binary is installed 打开一个新的本地shell /终端窗口并键入which php将告诉你php二进制文件的安装位置

in some ubuntu releases the repo's install php as php5, if that is the case you might need an ln -s to php 在一些ubuntu发布repo的安装php为php5,如果是这种情况你可能需要一个ln -s到php

Although in my PhpStorm (PS-138.2071) it looks like this : 虽然在我的PhpStorm(PS-138.2071)中它看起来像这样: 在此输入图像描述

This is done on settings level. 这是在设置级别完成的。 Don't do it in project sdk level. 不要在项目sdk级别执行此操作。 Got to settings, look for php. 得到设置,寻找PHP。 Choose PHP language level and intellij will scan and get the interpreter for you 选择PHP语言级别,intellij将扫描并为您获取解释器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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