gpt4 book ai didi

php - 无法在 codeigniter 中加载 google api php 客户端库

转载 作者:可可西里 更新时间:2023-10-31 23:06:52 26 4
gpt4 key购买 nike

当我使用 APPPATH.'libraries/Google/Client.php' 时,所有包含在 require_once 中的文件,子文件即(Auth/AssertionCredentials.php)

A PHP Error was encountered

Severity: Warning

Message: require_once(Google/Auth/AssertionCredentials.php): failed to open stream: No such file or directory

Filename: Google/Client.php

Line Number: 18

最佳答案

将“Google”文件夹复制到 third_party。

在名为 google.php 的应用程序/库下创建新文件

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
set_include_path(APPPATH . 'third_party/' . PATH_SEPARATOR . get_include_path());
require_once APPPATH . 'third_party/Google/Client.php';

class Google extends Google_Client {
function __construct($params = array()) {
parent::__construct();
}
}

然后使用:

$this->load->library('google');
echo $this->google->getLibraryVersion();

关于php - 无法在 codeigniter 中加载 google api php 客户端库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24262779/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com