No such file or directory in ........./googleads-php-lib-master/src/Google/Api/Ads/Common/Lib/AdsUser.php

116 views
Skip to first unread message

Tomasz Smykowski

unread,
Oct 7, 2016, 9:39:24 AM10/7/16
to AdWords API Forum
Hello,

I have downloaded a googleads-php-lib-master on my server with PHP 5.3.

In my code in PHP i have added example like this:

require_once 'googleads-php-lib-master/src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php';

$user = new AdWordsUser();

$campaignService = $user->GetService('CampaignService', 'v201603');

// Create selector.
$selector = new Selector();
$selector->fields = array('Id', 'Name');
$selector->ordering[] = new OrderBy('Name', 'ASCENDING');

// Create paging controls.
$selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);

// Make the get request.
$page = $campaignService->get($selector);

// Do something with the $page.
var_dump($page);

But i get an error:

require_once(Google/Api/Ads/Common/Util/AdsUtilityRegistry.php): failed to open stream: No such file or directory in <my subdirectory absolute path>/googleads-php-lib-master/src/Google/Api/Ads/Common/Lib/AdsUser.php on line 28
PHP Fatal error:  require_once(): Failed opening required 'Google/Api/Ads/Common/Util/AdsUtilityRegistry.php' (include_path='.:/usr/local/php53/lib/php') in <my subdirectory relative path>/googleads-php-lib-master/src/Google/Api/Ads/Common/Lib/AdsUser.php on line 28

Do i need to set up somewhere in settings.ini or other file a correct path to the place on my server where the library is located?



Shwetha Vastrad (AdWords API Team)

unread,
Oct 7, 2016, 11:20:27 AM10/7/16
to AdWords API Forum
Hi Tomasz,

The errors indicate that the included file is not available in the provided path. Have you tried using the GetCampaigns php example from the AdWords API PHP client library? Could you check if these files exist in the included path? One option might be to try using the absolute path of these files in the program. Let me know if this solves the issue. 

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages