Before you use Content Moderation SDK for PHP, you must install the required dependencies.
Prerequisites
PHP 5.5 or later is used.
Install the SDK
Download Content Moderation SDK for PHP.
Run the following command to install Content Moderation SDK for PHP:
composer require alibabacloud/greenRun the following command to install the required dependencies:
use AlibabaCloud\Green\Green;
Configure environment variables
In Alibaba Cloud SDK code, you can create a default access credential by defining ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables. When you call API operations of Alibaba Cloud services, the system directly accesses the credential, reads your AccessKey pair, and then automatically completes authentication. Before you use the SDK sample code, you must configure environment variables. For more information, see Configure credentials.