2012-07-24 35 views
0

我目前使用php可以文件作爲API的swift在SAIO安裝與tempauth。 執行PHP文件:內部服務器錯誤當使用php雲文件與迅速OpenStack

require('cloudfiles.php'); 
$username="test:teste"; 
$api_key="AUTH_tkfec9a726c0584d3d8f0150eb36446fd4"; 
$auth = new CF_Authentication($username, $api_key); 
$auth->authenticate(); 
if ($auth->authenticated()) 
    echo "CF Authentication successful \n"; 
else 
    echo "Authentication faile \n"; 

執行沒有工作,因爲一些認證問題:

PHP Fatal error: Uncaught exception 'AuthenticationException' with message 'Invalid username or access key.

的用戶名和API_KEY是校正(用快捷命令測試,我可以使運行在容器上swift?我想知道它是如何工作時認證?任何想法

回答

1

您不授予身份驗證主機URL,因此默認將https://auth.api.rackspace.com。這可能是問題。

Btw。您應該將該函數包裝在try-catch塊中。

echo "Authentication faile \n"; 

將永遠不會被調用,如果它不拋出一個異常,因爲authenticate()總是返回true。