Альтернатива, используемая, когда gRPC недоступен: REST . Он не требует установки какого-либо расширения PHP и основан на HTTP/1.1.
Если вы предпочитаете указывать тип транспорта самостоятельно, а не полагаться на правила по умолчанию, описанные выше, вы можете установить свойство transport в разделе CONNECTION вашего файла google_ads_php.ini :
[CONNECTION]
; Optional transport settings.
; By default, "grpc" is used if available otherwise "rest".
transport = "grpc"
Кроме того, вы можете настроить параметры транспорта программно, как и все остальные:
$googleAdsClient = (new GoogleAdsClientBuilder())
...
->withTransport('grpc')
->build();
[null,null,["Последнее обновление: 2024-11-24 UTC."],[[["The Google Ads API client library supports two transport types: gRPC (preferred) and REST (fallback)."],["gRPC offers better performance but requires the gRPC PHP extension, while REST is based on HTTP/1.1 and doesn't require any specific extension."],["You can manually specify your preferred transport type through the `google_ads_php.ini` configuration file or programmatically within your code."],["The gRPC version utilized by the library is usually managed through dependencies, primarily `google/gax`, and occasionally directly within the library's own `composer.json` for optimization or compatibility."]]],[]]