azure-sdk-for-php | Microsoft Azure SDK for PHP | Azure library
kandi X-RAY | azure-sdk-for-php Summary
kandi X-RAY | azure-sdk-for-php Summary
This project provides a set of PHP client libraries that make it easy to access Microsoft Azure tables, blobs, queues, service bus (queues and topics), service runtime and service management APIs. For documentation on how to host PHP applications on Microsoft Azure, please see the Microsoft Azure PHP Developer Center.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns a string representation of this object .
- Validate a PlayReadyLicenseResponseTemplate object
- Creates a new rule description .
- Serialize an object into an array .
- Receive a message .
- Creates a new Deployment .
- Acquire an access token with user credentials .
- Calculates the configuration changes .
- Initializes default properties .
- Sends an operation .
azure-sdk-for-php Key Features
azure-sdk-for-php Examples and Code Snippets
Community Discussions
Trending Discussions on azure-sdk-for-php
QUESTION
I am using this SDK: https://github.com/Azure/azure-sdk-for-php
And this addon: https://github.com/cocteau666/php-azure-session
To handle session in Azure Table Storage for my PHP based Wordpress site running in an Azure App Service.
When running the code from the last link, I get the following error:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
I am not using cURL directly, I am just using it through the code in azure-sdk-for-php and I cannot change that code.
So how do I identify which certificate is the problem and then globally define it so it will work.
I have already tried running this code just before and it doesn't throw an exception but it doesn't make any difference either. I don't know if I am using the correct .pem or whether this affects cURL globally.
...ANSWER
Answered 2017-Apr-26 at 10:40I found the solution here:
(although I used FTP for most of these steps)
- Open the web app in portal.azure.com
- Go to Application Settings and add this value in the App settings section: PHP_INI_SCAN_DIR = d:\home\site\ini
- Open web app's scm panel, for example - https://osi-bout-test.scm.azurewebsites.net/
- Go to Debug Console > CMD
- Open the "site" folder
- Upload the "cacert.pem" file (download it from here: http://curl.haxx.se/docs/caextract.html)
- Create/open the "ini" folder
- Create/open file with the name "settings.ini"
- Put this line inside the file: curl.cainfo = "D:\home\site\cacert.pem"
- Go back to the app in the portal.azure.com and STOP and then START.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install azure-sdk-for-php
Create a file named composer.json in the root of your project and add the following code to it:. Download composer.phar in your project root. Open a command prompt and execute this in your project root. Note On Windows, you will also need to add the Git executable to your PATH environment variable.
Create a file named composer.json in the root of your project and add the following code to it: { "require": { "microsoft/windowsazure": "^0.5" } }
Download composer.phar in your project root.
Open a command prompt and execute this in your project root php composer.phar install Note On Windows, you will also need to add the Git executable to your PATH environment variable.
There are four basic steps that have to be performed before you can make a call to any Microsoft Azure API when using the libraries.
First, include the autoloader script: require_once "vendor/autoload.php";
Include the namespaces you are going to use. To create any Microsoft Azure service client you need to use the ServicesBuilder class: use WindowsAzure\Common\ServicesBuilder; To process exceptions you need: use WindowsAzure\Common\ServiceException;
To instantiate the service client you will also need a valid connection string. The format is: For accessing a live storage service (tables, blobs, queues): DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey] For accessing the emulator storage: UseDevelopmentStorage=true For accessing the Service Bus: Endpoint=[yourEndpoint];SharedSecretIssuer=[yourWrapAuthenticationName];SharedSecretValue=[yourWrapPassword] Where the Endpoint is typically of the format https://[yourNamespace].servicebus.windows.net. For accessing Service Management APIs: SubscriptionID=[yourSubscriptionId];CertificatePath=[filePathToYourCertificate]
Instantiate a "REST Proxy" - a wrapper around the available calls for the given service. For the Storage services: $tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString); $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString); $queueRestProxy = ServicesBuilder::getInstance()->createQueueService($connectionString); For Service Bus: $serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString); For Service Management: $serviceManagementRestProxy = ServicesBuilder::getInstance()->createServiceManagementService($connectionString); For Media Services: // 1 - Instantiate the credentials $credentials = new AzureAdTokenCredentials( '<tenant domain name>', new AzureAdClientSymmetricKey('<service principal client id>', '<service principal client key>'), AzureEnvironments::AZURE_CLOUD_ENVIRONMENT()); // 2 - Instantiate a token provider $provider = new AzureAdTokenProvider($credentials); // 3 - Connect to Azure Media Services $mediaServicesRestProxy = ServicesBuilder::getInstance()->createMediaServicesService(new MediaServicesSettings('<rest api endpoint>', $provider)); You can find more examples for Media Services Authentication on the examples folder.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page