【发布时间】:2016-02-06 20:57:16
【问题描述】:
我使用 HostPapa,他们不允许 Shell 访问,只允许 FTP。如何在我的服务器上安装 Google 的 API 客户端库?我也是 git 的菜鸟。我正在尝试遵循本指南...
https://developers.google.com/api-client-library/php/start/installation
但我需要 Composer 或 Shell 访问权限。还有其他方法吗?非常感谢。
编辑:尝试一些东西。我将库上传到我的工作目录。
set_include_path(get_include_path() . PATH_SEPARATOR . '/google-api-php-client-1.1.7/src');
require 'Google/autoload.php';
require 'Google/Client.php';
// my code...
当我尝试运行我的 php 脚本时,我得到了
<b>Warning</b>: require(Google/autoload.php): failed to open stream: No such file or directory in <b>/path/to/my/script.php</b> on line <b>37</b><br />
<br />
<b>Warning</b>: require(Google/autoload.php): failed to open stream: No such file or directory in <b>/path/to/my/script.php</b> on line <b>37</b><br />
<br />
<b>Fatal error</b>: require(): Failed opening required 'Google/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/google-api-php-client-1.1.7/src') in <b>/path/to/my/script.php</b> on line <b>37</b><br />
编辑:K,我搞砸了……应该是……
set_include_path(get_include_path() . PATH_SEPARATOR . 'google-api-php-client-1.1.7/src');
require 'Google/autoload.php';
require 'Google/Client.php';
// my code...
我必须在我的相对路径的开头取出“/”。
【问题讨论】:
标签: php git shell ftp google-api-php-client