简体   繁体   English

如何在PHP中包含Google客户端库的路径

[英]How do I include a path of google client library in php

$r = set_include_path(get_include_path() . '\google-api-php-client-master\src');
echo $r;
require_once 'Google/Client.php';
require_once 'Google/Service/AdExchangeSeller.php';

function __autoload($class_name) {
  include 'examples/' . $class_name . '.php';
}

when I am running it on browser its showing following error.. 当我在浏览器上运行它时,它显示以下错误。 在此处输入图片说明

You are not using the path seperator when calling set_include_path, try this: 调用set_include_path时未使用路径分隔符,请尝试以下操作:

$r = set_include_path(get_include_path() . PATH_SEPARATOR . '\google-api-php-client-master\src');

Here is the documentation on set_include_path 这是有关set_include_path的文档

Edit 编辑

Did you restart Apache after making the change to your php.ini? 对php.ini进行更改后,是否重新启动了Apache?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在php.ini中包含PHP Exif库 - How do I include PHP Exif Library in php.ini 如何在PHP中设置绝对包含路径? - How do I set an absolute include path in PHP? 如何包含当前主题路径中的PHP文件? - How do I include a PHP file which is in the current theme path? 我怎么知道PHP将使用哪个包含路径? - How do I know which include path will be used in PHP? 如何在Python包中包含PHP库(不这样做) - How to include PHP library in Python package (on not do it) 如何检索Google Calendar Resources PHP API客户端? - How do I retrieve Google Calendar Resources PHP API client? 无法在我的php文件中包含google api php客户端库(google-api-php-clientsrc / Google / autoload.php) - unable include google api php client library (google-api-php-clientsrc/Google/autoload.php) in my php file 通过set_include_path动态包含Google Api Client库类 - Including Google Api Client library classes through set_include_path dynamically 如何使用Google_Client库将文件上传到Google云存储中的目录 - how do i upload a file to a directory in google cloud storage using Google_Client library 使用 Google Cloud PubSub Client Library for php 时,我们如何最大限度地减少超时? - How do we minimise the timeout when using Google Cloud PubSub Client Library for php?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM