All Products
Search
Document Center

Machine Translation:PHP SDK

Last Updated:Apr 01, 2026

Get started with the Machine Translation PHP SDK to integrate translation capabilities into your application.

Prerequisites

Before you begin, ensure that you have:

  • A PHP development environment

  • An Alibaba Cloud account with an active AccessKey pair

The SDK source is available on GitHub: SDK download

Step 1: Create an Alibaba Cloud account

Register an account if you do not already have one. Complete real-name verification to avoid service restrictions.

Step 2: Get an AccessKey pair

An AccessKey pair consists of an AccessKey ID and an AccessKey Secret, which authenticate your SDK requests.

  1. Log on to the AccessKey management page.

  2. Select an existing AccessKey pair or create a new one. Make sure the key status is Enabled.

Important

Store your AccessKey Secret securely. Never expose it in source code or public repositories. For production environments, load credentials from environment variables rather than hardcoding them.

Step 3: Start a new PHP project

You can use any text editor or PHP IDE to run sample code to interact with the Machine Translation service and obtain the corresponding outputs.

For sample code, see SDK examples (PHP).

What's next

  • Explore other translation operations in the Machine Translation API reference

  • Learn about supported language pairs and format types in the Machine Translation documentation