定义缺省运行配置

另请参见

运行配置可满足最常用的 PHP 开发用例的需要。运行配置是用于运行 PHP 项目的存储设置。您可以为一个项目定义若干个配置,并在这些配置之间来回切换。运行配置既适用运行操作,又适用调试操作。

注意:在项目创建过程中,将定义缺省运行配置。要定义其他运行配置,请定制项目设置。

要设置项目的缺省运行配置,请从“运行方式”下拉列表中选择相关的选项。可以使用以下选项:

本地 Web 站点

从“运行方式”下拉列表中,选择“本地 Web 站点”。接下来的操作过程会因项目类型而有所不同。

不包含以前开发的源代码的项目

  1. 在“项目 URL”字段中,检查自动生成的 URL 地址。确保 Apache HTTP 服务器侦听缺省端口 80。否则,请明确指定端口号:
    localhost:<端口号>
                    
  2. 要单独存储项目的源文件,请选中“将源文件夹中的文件复制到其他位置”复选框。
  3. 在“复制到以下文件夹”字段中,指定存储位置。

包含以前开发的源代码的项目

  1. 选中“将源文件夹中的文件复制到其他位置”复选框。
  2. 在“复制到以下文件夹”字段中,指定 Web 服务器上要存储源文件的文件夹。如有必要,请使用“浏览”按钮。
    缺省情况下,该字段将指定以下路径:<文档根目录>\<新 PHP 项目>
    Web 服务器会从文档根目录文件夹中查找要在浏览器中打开的文件。文档根目录是在 Web 服务器配置文件中指定的。
    The wizard detects the and provides the path to the default location of the htdocs folder. 如果在安装 Apache 服务器或 AMP 包的过程中接受了缺省设置,请从下拉列表中选择相关的路径。
  3. 在“项目 URL”字段中,检查自动生成的 URL 地址。确保 Apache HTTP 服务器侦听缺省端口 80。否则,请明确指定端口号:
    localhost:<端口号>
                    

If you are using Remote Debugging or Symbolic Links, click Advanced and set up path mapping. See Path Mapping.

远程 Web 站点

  1. From Run As dropdown list, choose Remote Web Site (FTP/SFTP).
  2. From the Remote Connection dropdown list, choose the relevant connection profile.
  3. To create, update, or remove an (S)FTP Connection profile, click Manage. The Manage Remote Connections dialog box opens with the fields showing the current (S)FTP connection profile settings. (If there are no existing connection profiles, the Create New Connection dialog opens automatically when you click Manage.)
  4. To create a new (S)FTP connection profile, click Add. 将打开“创建新连接”对话框。
  5. 在“连接名称”字段中,输入新连接的名称,然后单击“确定”。将显示“管理远程连接”对话框,并在“连接名称”显示字段中包含新连接的名称。
  6. From the Type dropdown list, choose FTP or SFTP.
  7. In the Host Name field, enter the (S)FTP Server name as it is written in the (S)FTP account creation confirmation message.
  8. In the Port field, specify 21 for an FTP and 22 for an SFTP connection.
  9. In the User Name field, enter your FTP Username as it is written in the (S)FTP account creation confirmation message.
  10. 填写“口令”字段。
  11. In the Initial Directory field, enter the name of your account directory on the (S)FTP server and click OK. 将返回到“运行配置”面板。
  12. 在“上载目录”字段中,输入初始目录中将上载源文件的子文件夹名称。该字段下的提示显示 FTP 主机 URL。
  13. 要指定上载文件的时间,请从“上载文件”下拉列表中选择相关的选项。The available options are: Manually, On Save, and On Run.
  14. You also have the options to Preserve Remote File Permissions or Upload Files Directly.

If you are using Remote Debugging or Symbolic Links, click Advanced and set up path mapping. See Path Mapping.

脚本

  1. 从“运行方式”下拉列表中,选择“脚本”。
  2. 要指定 PHP 引擎的位置,请单击“PHP 解释器”字段旁边的“配置”按钮。将打开“选项”对话框的 "PHP" 标签。
  3. 在“PHP 5 解释器”字段中,指定 php.exe 文件的路径。如有必要,请使用“浏览”按钮。
  4. 要指定脚本执行结果的显示方式,请在“显示结果的位置”区域中选中相关的复选框。可以使用以下选项:

  5. 单击“确定”。将关闭“选项”对话框,并且系统返回到“运行配置”面板。

Path Mapping

If you are using Remote Debugging or Symbolic Links, you need to manually define path mapping for individual run configurations. To define path mapping:

  1. In the Run Configuration panel, click Advanced (not available for Script configurations). The Advanced Web Configuration dialog opens.
  2. Select the debug URL:
    • The default URL, as shown in the panel
    • Ask Every Time, which prompts you for the URL every time you start a debugging session
    • Do Not Open Browser, which starts the debug session without opening a browser window. You need to open your web browser and browse for the URL. Note that the GET (or POST) variable XDEBUG_SESSION_START is needed.
  3. Click New to add a mapping. Enter the server path and the project path.
  4. If you are using the Debugger Proxy, enter the host name and port.
另请参见
不包含以前开发的源代码的新 PHP 项目
将以前开发的源文件导入到新项目中

法律声明