2014-05-01 46 views
0
set_include_path("google-api-php-client/src/google"); 
require_once 'Client.php'; 
require_once '/Service/CalendarService.php'; 

結果:沒有這樣的文件或目錄PHP谷歌日曆

Warning: require_once(Google/Auth/AssertionCredentials.php): failed to open stream: No such file or directory in D:\xampp\htdocs\xampp\GoogleCalendar\google-api-php-client\src\Google\Client.php on line 18 
Fatal error: require_once(): Failed opening required 'Google/Auth/AssertionCredentials.php' (include_path='google-api-php-client/src/google') in D:\xampp\htdocs\xampp\GoogleCalendar\google-api-php-client\src\Google\Client.php on line 18 

請讓我知道我錯了。

+0

PHP無法找到您要告訴它尋找它們的文件 – Eeji

回答

0

假設我在我的/ home /用戶/分析目錄(空目錄),當我通過git的下載分析API:

git clone https://github.com/google/google-api-php-client.git 

我得到這些錯誤,當我嘗試使用Client.php 。我已修改

/home/user/analytics/google-api-php-client/src/Google/Client.php像這樣;在要求行之前添加四行:

$dirArray = explode('/', dirname(__FILE__)); 
$homeDir = $dirArray[2]; 

$path = '/home/' . $homeDir . '/analytics/google-api-php-client/src/'; 
set_include_path(get_include_path() . PATH_SEPARATOR . $path); 
相關問題