小编Mal*_*med的帖子

yii2超过了120秒的最大执行时间

我上传了一个包含1000行的excel文件,默认情况下我只有2分钟的执行时间,那时我可以上传400条记录.我收到这个错误Maximum execution time of 120 seconds exceeded

我如何在yii2框架中修改这段时间?

php execution-time yii2

14
推荐指数
1
解决办法
3万
查看次数

该服务目前不可用 Google api

我正在使用 google Slide API 连接到我的项目帐户,连接工作正常,但有时我会收到此错误:

致命错误:未捕获的 Google_Service_Exception: { "error": { "code": 503, "message": "该服务当前不可用。", "errors": [ { "message": "该服务当前不可用。", /vendor/google/apiclient/src/Google/Http/REST.php:118 中的“domain”:“global”,“reason”:“backendError” } ],“status”:“UNAVAILABLE” } } 堆栈跟踪:# 0 /vendor/google/apiclient/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(对象(GuzzleHttp\Psr7\Response),对象(GuzzleHttp\Psr7\Request),'Google_Service_...' ) #1 /vendor/google/apiclient/src/Google/Task/Runner.php(181): Google_Http_REST::doExecute(对象(GuzzleHttp\Client), 对象(GuzzleHttp\Psr7\Request), 'Google_Service_...' ) #2 /vendor/google/apiclient/src/Google/Http/REST.php(58): Google_Task_Runner->在 /vendor/google/apiclient/src/Google/Http/REST.php 第 118 行运行

这是我的 getClient 函数 Google API:

function getClient(string $SCOPES,string $CLIENT_SECRET_PATH,string $CREDENTIALS_PATH,string $APPLICATION_NAME) {

    $this->client->setApplicationName($APPLICATION_NAME);
    $this->client->setScopes($SCOPES);
    $this->client->setAuthConfig($CLIENT_SECRET_PATH);
    $this->client->setAccessType('offline');
    $this->client->setApprovalPrompt('force');

    $credentialsPath = $this->expandHomeDirectory($CREDENTIALS_PATH);
    if (file_exists($credentialsPath)) {
        $accessToken = json_decode(file_get_contents($credentialsPath), true);
    } else {

        $authUrl = $this->client->createAuthUrl();
        printf("Open the following link …
Run Code Online (Sandbox Code Playgroud)

php google-api access-token google-slides-api

9
推荐指数
1
解决办法
1万
查看次数