I have created the composer.json file in my root folder where my index.php file is presents, with the following code in it:
{
"require": {
"microsoft/windowsazure": "^0.5"
}
}
and on downloading composer.phar, I have installed it using:
php composer.phar install
I'm trying to create a table and add entities to it in php. I use the command
use WindowsAzure\Common\ServicesBuilder;
$connectionString = 'DefaultEndpointsProtocol=https;AccountName=******;AccountKey=***/***************************/******************/**********************************==';
$tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString);
try {
// Create table.
$tableRestProxy->createTable("mytable");
}
catch(ServiceException $e){
$code = $e->getCode();
$error_message = $e->getMessage();
echo $code.": ".$error_message."<br />";
}
When I run this on local host on my Ubuntu, I get an error saying-
Uncaught Error: Class 'WindowsAzure\Common\ServicesBuilder' not found in /home/my_folder/php-docs-hello-world-master/index.php:30
If I add
require_once 'vendor/autoload.php';
before defining my $connectionString, then my error changes to:
/index.php - Uncaught RuntimeException: Error creating resource: [message] fopen(https://eyesav.table.core.windows.net/Tables): failed to open stream: Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?
Can someone help me figure out this issue, if it is with the installation of my composer, or my connectionString, or something else?
Thanks in advance :)