dongle3217 2013-06-26 03:51
浏览 58

使用Google自定义搜索API时未显示配置

The following script is provided by google api php client

<?php
require_once 'src/Google_Client.php';
require_once 'src/contrib/Google_CustomsearchService.php';
session_start();

$client = new Google_Client();
$client->setApplicationName('Google CustomSearch PHP Starter Application');
$client->setDeveloperKey('API KEY');
$search = new Google_CustomsearchService($client);

try{
     $result = $search->cse->listCse('burrito', array('cx' => 'SEARCH ENGINE ID'));
     print "<pre>" .print_r($result, true) . "</pre>";
}catch(Exception $e)
{
     echo("<pre>".print_r($e,true)."</pre>");
}
?>

When The script is executed the following error is displayed even when custom search is enabled in the services tab.

Google_ServiceException Object
(
    [errors:protected] => Array
        (
            [0] => Array
                (
                    [domain] => usageLimits
                    [reason] => accessNotConfigured
                    [message] => Access Not Configured
                )

        )
  • 写回答

2条回答 默认 最新

  • dongqian1925 2013-06-26 03:57
    关注

    https://code.google.com/apis/console

    register your IPv6 address not the IPv4

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分