Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 搜索时出现Google Drive内部服务器错误_Php_Google Drive Api - Fatal编程技术网

Php 搜索时出现Google Drive内部服务器错误

Php 搜索时出现Google Drive内部服务器错误,php,google-drive-api,Php,Google Drive Api,使用q参数搜索时出现错误: php代码: $parameters['q'] = "title = 'hello'"; $children = $service->children->listChildren('root',$parameters); 返回: 致命错误:未捕获异常“Google\u ServiceException”并显示消息 '调用GET时出错 : (500)内部错误' 我认为这与引号有关,因为如果我搜索“trashed=false”,它会起作用 我正在使用从以下

使用q参数搜索时出现错误:

php代码:

$parameters['q'] = "title = 'hello'"; 
$children = $service->children->listChildren('root',$parameters);
返回:

致命错误:未捕获异常“Google\u ServiceException”并显示消息 '调用GET时出错 : (500)内部错误'

我认为这与引号有关,因为如果我搜索“trashed=false”,它会起作用

我正在使用从以下位置签出的最新api客户端:

经过这段时间后,再次尝试,现在可以正常工作。

如果您没有请求正确的权限,则会收到相同的错误消息。使用范围
https://www.googleapis.com/auth/drive
,而不是(仅)
https://www.googleapis.com/auth/drive.file

您能否尝试一下,并告诉我们它是否也失败了?确保通过切换OAuth 2.0按钮来授权应用程序。另外,您可以尝试使用
$service->files->list(数组('q'=>“title='hello'和root-in-parents”)
?我想这可能是一个暂时的问题,我在OAuth游乐场和PHP应用程序中进行了尝试,在这两种情况下都按预期工作。$service->files->list(数组('q'=>“title='hello'和root-in-parents”))失败“致命错误:未捕获异常‘Google_ServiceException’并显示消息‘错误调用GET:(400)无效值’”-但如果我忽略了“和根在父对象中”这一非暂时性问题,则可以正常工作-仍然可以重新创建此问题我的错误,查询参数应为
“title='hello'和'root'在父对象中”
(注意
根对象周围的引号)。