0
我已經在Azure網站上運行了舊的PHP azure SDK,但我想遷移到新的。不幸的是,我無法獲得新的工作。如何讓(新)Azure PHP SDK正常工作?
我已經手動安裝了SDK,並遵循此頁面上的「使用」步驟:https://github.com/Azure/azure-sdk-for-php。而不是'使用'我使用'require',也許這就是它出錯的地方,但我不知道如何使用命名空間。
我用來編輯我的代碼的環境是dreamweaver。
下面的代碼在線路出現問題開始$tableRestProxy
<?php
require("WindowsAzure/WindowsAzure.php");
require("WindowsAzure/Common/ServicesBuilder.php");
require("WindowsAzure/Common/ServiceException.php");
require("WindowsAzure/Table/TableRestProxy.php");
$connectionString = 'DefaultEndpointsProtocol=https;AccountName=[AccountName];AccountKey=[AccountKey]';
// I do know that I have to declare the AccountName and AccountKey here. Left it out for privacy reasons.
$tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString);
?>
更新
現在我試圖用Composer來安裝SDK。我composer.json文件看起來像這樣:
{
"require": {
"microsoft/windowsazure": "*"
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"minimum-stability": "dev"
}
當我運行composer.phar我得到以下結果:
[email protected] /e/Users/Public/Documents/00_speeltuin_azure/newsdk
$ php composer.phar diagnose
Checking composer.json: OK
Checking platform settings: FAIL
The xdebug extension is loaded, this can slow down Composer a little.
Disabling it when using Composer is recommended, but should not cause issues bey
ond slowness.
Checking git settings: OK
Checking http connectivity: OK
Checking disk free space: OK
Checking composer version: OK
[email protected] /e/Users/Public/Documents/00_speeltuin_azure/newsdk
$ php composer.phar install
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for microsoft/windowsazure 0.4.0 -> satisfiable by mi
crosoft/windowsazure[v0.4.0].
- microsoft/windowsazure v0.4.0 requires pear-pear/http_request2 * -> no mat
ching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your min
imum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
problems.
我不明白我在做什麼錯。
您是如何安裝SDK的?使用Composer還是Pear? –
@ SyntaxC4不,我手動安裝; http://azure.microsoft.com/nl-nl/documentation/articles/php-download-sdk/。但我現在看到SDK對其他軟件包有依賴性,現在我會嘗試。 – Jeroen
@ SyntaxC4現在我正在嘗試通過Composer進行安裝,但我得到以下結果:https://www.dropbox.com/s/z54ezpki1136bpx/Screenshot%202014-06-26%2011.17.34.png這是第一個當我使用作曲家時,你看到我做錯了什麼嗎?這是我的composer.json文件:https://www.dropbox.com/s/klebxcycpaay7w4/Screenshot%202014-06-26%2011.20.04.png – Jeroen