K
K
Kooper_pro2019-04-09 06:32:52
Composer
Kooper_pro, 2019-04-09 06:32:52

How to install FacebookAds sdk on Composer?

The situation is this I am on a simple hosting, there is no way to install the conposer itself, I downloaded the vendor folder
5cac10588fda8383064515.jpeg
downloaded from the git hub https://github.com/facebook/facebook-php-business-sdk , Facebook Ads, and uploaded it to the server folder in "src "
5cac11127a46c648725146.jpeg
Google is doing fine. And here is Facebook.

require_once __DIR__ . '/api/vendor/autoload.php';

use FacebookAds\Object\AdAccount;
use FacebookAds\Object\AdsInsights;
use FacebookAds\Api;
use FacebookAds\Logger\CurlLogger;

$access_token = 'указан';
$ad_account_id = 'указан';
$app_secret = 'указан';
$app_id = 'указан';

$api = Api::init($app_id, $app_secret, $access_token);
$api->setLogger(new CurlLogger());

Error when starting
Fatal error: Uncaught Error: Class 'FacebookAds\Api' not found in
How to cure?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
irishmann, 2019-04-09
@irishmann

Obviously write the dependencies in composer.json and composer.lock manually

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question