Hi, Before you try to render results in a page, have you been able to successfully run any of the PHP library examples <https://github.com/googleads/googleads-php-lib/tree/master/examples/AdWords/v201409> *from the command line*? Also, I'd check under your *include_path* for the file mentioned in the error (Logger.php). If you downloaded the library from github <https://github.com/googleads/googleads-php-lib>, that file should be in the directory specified. If not, please try downloading the library again and make sure you include all directories in the library.
Thanks, Josh, AdWords API Team On Tuesday, December 30, 2014 6:02:36 AM UTC-5, [email protected] wrote: > > I am trying to integrate google adwords api in my website ,but it's > display some errors > > code is : > > error_reporting(-1); > ini_set('display_errors',1); > $path = dirname(__FILE__) . '/../../src'; > set_include_path(get_include_path() . PATH_SEPARATOR . $path); > > require_once 'adwordsAPI/src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php'; > > try { > // Get AdWordsUser from credentials in "../auth.ini" > // relative to the AdWordsUser.php file's directory. > $user = new AdWordsUser(); > > // Log SOAP XML request and response. > $user->LogDefaults(); > > // Get the AdGroupAdService. > $adGroupAdService = $user->GetAdGroupAdService(); > > $adGroupId = (float) '01'; > > // Create selector. > $selector = new Selector(); > $selector->fields = array('Id', 'AdGroupId', 'Status'); > $selector->ordering = array(new OrderBy('Id', 'ASCENDING')); > > // Create predicates. > $adGroupIdPredicate = new Predicate('AdGroupId', 'IN', > array($adGroupId)); > // By default disabled ads aren't returned by the selector. To return > them > // include the DISABLED status in a predicate. > $statusPredicate = > new Predicate('Status', 'IN', array('ENABLED', 'PAUSED', 'DISABLED')); > $selector->predicates = array($adGroupIdPredicate, $statusPredicate); > > // Get all ads. > $page = $adGroupAdService->get($selector); > > // Display ads. > if (isset($page->entries)) { > foreach ($page->entries as $adGroupAd) { > printf("Ad with id '%s', type '%s', and status '%s' was found.\n", > $adGroupAd->ad->id, $adGroupAd->ad->AdType, $adGroupAd->status); > } > } else { > print "No ads were found.\n"; > } > } catch (Exception $e) { > echo 'Inside catch exception'; > print $e->getMessage(); > } > > And Error is : > > > Warning: require_once(Google/Api/Ads/Common/Util/Logger.php): failed to > open stream: No such file or directory in /var/www/vhosts/ > healthcampaign.in/httpdocs/smscampaign/pages/adwordsAPI/src/Google/Api/Ads/Common/Lib/AdsUser.php > > on line 31 Fatal error: require_once(): Failed opening required > 'Google/Api/Ads/Common/Util/Logger.php' (include_path='.::/var/www/vhosts/ > healthcampaign.in/httpdocs/smscampaign/pages/../../src') in > /var/www/vhosts/ > healthcampaign.in/httpdocs/smscampaign/pages/adwordsAPI/src/Google/Api/Ads/Common/Lib/AdsUser.php > > on line 31 > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/58f3ea2a-f3b4-4b02-a823-af1381d0fb7b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
