下载 Azure SDK for PHPDownload the Azure SDK for PHP

概述Overview

Azure SDK for PHP 包括允许你针对 Azure 开发、部署和管理 PHP 应用程序的组件。The Azure SDK for PHP includes components that allow you to develop, deploy, and manage PHP applications for Azure. 具体而言,Azure SDK for PHP 包括以下组件:Specifically, the Azure SDK for PHP includes the following:

  • Azure 的 PHP 客户端库The PHP client libraries for Azure. 这些类库提供用于访问 Azure 功能(例如数据管理服务和云服务)的接口。These class libraries provide an interface for accessing Azure features, such as data management services and cloud services.
  • 适用于 Mac、Linux 和 Windows 的 Azure 命令行接口 (Azure CLI)The Azure Command-Line Interface for Mac, Linux, and Windows (Azure CLI). 这是一组用于部署和管理 Azure 服务(例如 Azure 网站和 Azure 虚拟机)的命令。This is a set of commands for deploying and managing Azure services, such as Azure Websites and Azure Virtual Machines. Azure CLI 可在任何平台(包括 Mac、Linux 和 Windows)上使用。The Azure CLI work on any platform, including Mac, Linux, and Windows.
  • Azure PowerShell(仅限 Windows)Azure PowerShell (Windows Only). 这是一组用于部署和管理 Azure 服务(例如云服务和虚拟机)的 PowerShell cmdlet。This is a set of PowerShell cmdlets for deploying and managing Azure Services, such as Cloud Services and Virtual Machines.
  • Azure 模拟器(仅限 Windows)The Azure Emulators (Windows Only). 计算和存储模拟器是一系列云服务和数据管理服务的本地模拟器,允许你在本地测试应用程序。The compute and storage emulators are local emulators of cloud services and data management services that allow you to test an application locally. Azure 模拟器仅在 Windows 上运行。The Azure Emulators run on Windows only.

以下各节将介绍如何下载和安装上述组件。The sections below describe how to download and install the components described above.

本主题中的说明假定用户已安装 PHPThe instructions in this topic assume that you have PHP installed.

Note

若要使用 Azure 的 PHP 客户端库,则必须安装 PHP 5.5 或更高版本。You must have PHP 5.5 or higher to use the PHP client libraries for Azure.

Azure 的 PHP 客户端库PHP client libraries for Azure

Azure 的 PHP 客户端库提供了一个用于从任何操作系统访问 Azure 功能(例如,数据管理服务和云服务)的接口。The PHP Client Libraries for Azure provide an interface for accessing Azure features, such as data management services and cloud services, from any operating system. 可以通过 Composer 安装这些库。These libraries can be installed via the Composer.

有关如何使用 Azure 的 PHP 客户端库的信息,请参阅如何使用 Blob 服务如何使用表服务以及如何使用队列服务For information about how to use the PHP Client Libraries for Azure, see How to Use the Blob Service, How to Use the Table Service and How to Use the Queue Service.

通过 Composer 安装Install via Composer

  1. 安装 GitInstall Git. 在 Windows 上,还需要向 PATH 环境变量添加 Git 可执行文件。On Windows, you will also need to add the Git executable to your PATH environment variable.

  2. 在项目的根目录中创建名为 composer.json 的文件并向其添加以下代码:Create a file named composer.json in the root of your project and add the following code to it:

    {
        "require": {
            "microsoft/windowsazure": "^0.4"
        }
    }
    
  3. composer.phar 下载到项目根目录中。Download composer.phar in your project root.

  4. 打开命令提示符并在项目根目录中执行该文件Open a command prompt and execute this in your project root

    php composer.phar install
    

Azure PowerShell 和 Azure 模拟器Azure PowerShell and Azure Emulators

Azure PowerShell 是一组用于部署和管理 Azure 服务(例如,云服务和虚拟机)的 PowerShell cmdlet。Azure PowerShell is a set of PowerShell cmdlets for deploying and managing Azure Services (such as Cloud Services and Virtual Machines). Azure 模拟器是一系列云服务和数据管理服务的模拟器,可让你在本地测试应用程序。The Azure Emulators are emulators of cloud services and data management services that allow you to test an application locally. 这些组件仅受 Windows 支持。These components are supported Windows only.

安装 Azure PowerShell 和 Azure 模拟器的建议方法是使用 Microsoft Web 平台安装程序The recommended way to install Azure PowerShell and the Azure Emulators is to use the Microsoft Web Platform Installer. 请注意,也可以选择安装其他开发组件,如 PHP、SQL Server、Microsoft Drivers for SQL Server for PHP 和 WebMatrix。Note that you can also choose to install other development components, such as PHP, SQL Server, the Microsoft Drivers for SQL Server for PHP, and WebMatrix.

有关如何使用 Azure PowerShell 的信息,请参阅如何使用 Azure PowerShellFor information about how to use Azure PowerShell, see How to Use Azure PowerShell.

Azure CLIAzure CLI

Azure CLI 是一组用于部署和管理 Azure 服务(例如 Azure 网站和 Azure 虚拟机)的命令。The Azure CLI is a set of commands for deploying and managing Azure services, such as Azure Websites and Azure Virtual Machines. 有关安装 Azure CLI 的信息,请参阅安装 Azure CLIFor information about installing Azure CLI, see Install the Azure CLI.

后续步骤Next steps

有关详细信息,请参阅 PHP 开发中心For more information, see the PHP Developer Center.