如何在没有 Shell (SSH) 访问权限的情况下为 php 在服务器上安装 Google API 客户端库?
How can I install Google API client library on server for php without Shell (SSH) access?
我在 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...
我不得不去掉相对路径开头的'/'。
- 从以下位置下载发布版本:https://github.com/google/google-api-php-client/releases
- 设置包含路径:set_include_path(get_include_path() . PATH_SEPARATOR . 'your/path/to/src');
- 现在包含自动加载器文件:require 'Google/autoload.php';
- 您的任务:
需要 'Google/Client.php'; // 你的东西
我在 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...
我不得不去掉相对路径开头的'/'。
- 从以下位置下载发布版本:https://github.com/google/google-api-php-client/releases
- 设置包含路径:set_include_path(get_include_path() . PATH_SEPARATOR . 'your/path/to/src');
- 现在包含自动加载器文件:require 'Google/autoload.php';
- 您的任务: 需要 'Google/Client.php'; // 你的东西