আপনি যদি পারেন তবে আমরা সি বাস্তবায়ন ব্যবহার করার পরামর্শ দিই, তবে কিছু ক্ষেত্রে পিএইচপি প্রয়োজন হতে পারে (যেমন যখন নিরাপত্তা বা প্রযুক্তিগত সীমাবদ্ধতা দ্বারা সীমাবদ্ধ)।
কম্পোজারের অন্যান্য googleapis/gax-php নির্ভরতার মতো পিএইচপি বাস্তবায়ন স্বয়ংক্রিয়ভাবে ইনস্টল করা হয়, তবে এটি রানটাইমে ব্যবহার করা হয় শুধুমাত্র যদি C বাস্তবায়ন ইনস্টল এবং কনফিগার করা না থাকে।
সি বাস্তবায়ন
Protobuf PHP এক্সটেনশন ইনস্টল এবং কনফিগার করতে:
কমান্ড লাইন থেকে sudo pecl install protobuf চালান।
php.ini ফাইলে একটি extension=protobuf.so লাইন যোগ করুন।
পিএইচপি বাস্তবায়ন
নিশ্চিত করুন যে সি বাস্তবায়ন নিষ্ক্রিয় করা হয়েছে এবং googleapis/gax-php লাইব্রেরির সমস্ত নির্ভরতা ইনস্টল করা আছে:
php.ini এ যেকোনো extension=protobuf.so লাইন কমেন্ট করুন।
যে ডিরেক্টরিতে কাজ করা হচ্ছে তার composer.json ফাইল রয়েছে সেখান থেকে composer install চালান। composer.jsongoogle-ads-php বা যেকোন প্রজেক্টের জন্য এটিকে নির্ভরতা হিসেবে উল্লেখ করা উচিত।
কোন বাস্তবায়ন ব্যবহার করা হচ্ছে তা নির্ধারণ করুন
php -i | grep protobuf :
খালি না হলে, আপনি সি বাস্তবায়ন ব্যবহার করছেন।
অন্যথায়, আপনি C বাস্তবায়ন ব্যবহার করছেন না এবং Google Ads API পিএইচপি লাইব্রেরি পিএইচপি বাস্তবায়নের উপর নির্ভর করবে (যদি কম্পোজার ব্যবহার করে সঠিকভাবে ইনস্টল করা হয়)।
[null,null,["2025-09-03 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Google Ads API for PHP offers two implementations: C (for performance) and PHP (for ease of use).\u003c/p\u003e\n"],["\u003cp\u003eThe C implementation utilizes the Protobuf PHP extension and requires manual installation via \u003ccode\u003epecl\u003c/code\u003e and \u003ccode\u003ephp.ini\u003c/code\u003e configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe PHP implementation is automatically installed with \u003ccode\u003egoogleapis/gax-php\u003c/code\u003e dependencies but is used only if the C implementation is unavailable.\u003c/p\u003e\n"],["\u003cp\u003eUsers can determine the active implementation by running \u003ccode\u003ephp -i | grep protobuf\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Protobuf implementations\n\nThere are two implementations that are available for PHP:\n\n1. **C** : Uses the [Protobuf PHP extension](//pecl.php.net/package/protobuf) which gives better performance.\n2. **PHP** : Uses the [`google/protobuf` PHP\n package](//packagist.org/packages/google/protobuf) which is easier to implement.\n\nWe recommend using the C implementation if you can, but PHP may be needed in\nsome cases (such as when limited by security or technical constraints).\n\nThe PHP implementation is automatically installed like any other\n[`googleapis/gax-php`](https://github.com/googleapis/gax-php) dependencies in\nComposer, but it is used at runtime **only if** the C implementation is not\ninstalled and configured.\n\nC implementation\n----------------\n\nTo install and configure the Protobuf PHP extension:\n\n1. Run `sudo pecl install protobuf` from the command line.\n2. Add an `extension=protobuf.so` line to the `php.ini` file.\n\nPHP implementation\n------------------\n\nMake sure the C implementation is disabled and all the dependencies of\nthe [`googleapis/gax-php`](https://github.com/googleapis/gax-php) library are\ninstalled:\n\n1. Comment out any `extension=protobuf.so` line in `php.ini`.\n2. Run `composer install` from the directory that contains the\n `composer.json` file of the project being worked on. The `composer.json`\n should specify `google-ads-php` or any project that requires it as a\n dependence.\n\n | **Key Point:** Typically, the protobuf version that this PHP library relies on is transitively specified in [`composer.json`](https://github.com/googleapis/gax-php/blob/master/composer.json) of `google/gax`, which is one of the core dependencies. But for performance or compatibility reasons, we may specify the protobuf version directly in the PHP library's [`composer.json`](https://github.com/googleads/google-ads-php/blob/HEAD/composer.json).\n\nDetermine which implementation is being used\n--------------------------------------------\n\nRun `php -i | grep protobuf`:\n\n- If *not* empty, you're using the C implementation.\n- Otherwise, you're *not* using the C implementation and the Google Ads API PHP library will rely on the PHP implementation (if installed correctly using Composer)."]]