LocalStorage and ConfigurationSettings

Aug 3, 2009 at 6:55 PM

Hi all,

How can I get the LocalStorage and ConfigurationSettings (ServiceDefinition file) info from my PHP application?

I need to read/write into Windows Azure file system (not blob) like this: http://blogs.mscommunity.net/blogs/dadamec/archive/2008/12/11/azure-reading-and-writing-with-localstorage.aspx

Thanks.

Coordinator
Aug 4, 2009 at 10:55 AM

Here's a partial take (not officially release by Microsoft, just an evening of coding):

http://blog.maartenballiauw.be/post/2009/08/04/Accessing-ServiceConfiguration-in-FastCGI-(PHP)-web-role.aspx

Storage is not supported, but logging and accessing config is.

Coordinator
Aug 4, 2009 at 11:54 AM

I've just added azure_getlocalresourcepath and azure_getlocalresourcepathsize methods. Download the latest DLL from my blog.

Aug 4, 2009 at 2:21 PM

Great job!

Does the DLL work with PHP 5.2.10 for Windows (Non Thread Safe) ? I can't  register it.

Thanks.

Coordinator
Aug 4, 2009 at 6:39 PM

Are you seeing errors? I have compiled it using 5.2.9 + WinXP, 32 bit, non-thread safe.
I will see if I can cross compile to another version when I get back at work tomorrow.

Aug 5, 2009 at 1:05 PM
Edited Aug 5, 2009 at 1:06 PM
maartenba wrote:

Are you seeing errors? I have compiled it using 5.2.9 + WinXP, 32 bit, non-thread safe.
I will see if I can cross compile to another version when I get back at work tomorrow.

  • PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_azure.dll' - The specified module could not be found. in Unknown on line 0
  • This application has failed to start because php5ts.dll was not found. Re-installing the application may fix this problem.

Thanks.

Coordinator
Aug 5, 2009 at 1:44 PM

Is this a PHP install from Web Platform installer? If yes, do the following:

  1. Download http://windows.php.net/downloads/releases/php-5.2.10-Win32-VC6-x86.zip (yes, the TS version)
  2. Extract the following files into C:\Program Files (x86)\PHP:
    • dev/php5.lib
    • ext/php_curl.dll
    • ext/php_exif.dll
    • ext/php_gd2.dll
    • ext/php_gettext.dll
    • ext/php_mbstring.dll
    • ext/php_mssql.dll
    • ext/php_mysql.dll
    • ext/php_mysqli.dll
    • ext/php_openssl.dll
    • ext/php_xmlrpc.dll
    • ext/php_zip.dll
    • libeay32.dll
    • libmysql.dll
    • ntwdblib.dll
    • php.exe
    • php5.dll
    • php5embed.lib
    • php5ts.dll
    • php-cgi.exe
    • ssleay32.dll
  3. (optional, if things do not work at this moment: copy C:\Program Files\Windows Azure SDK\v1.0\bin\devfabric\x86\msshrt.dll into C:\Program Files (x86)\PHP as well)

Seems thread-safe version is required...

Aug 5, 2009 at 2:27 PM

Thanks, but I need the non thread safe version.

Coordinator
Aug 6, 2009 at 5:47 AM

Found out how to compile non-thread-safe as well:

  • Compiled THREAD SAFE module php_azure.dll: php_azure-ts.zip (218.48 kb)
  • Compiled NON THREAD SAFE module php_azure.dll: php_azure-nts.zip (218.46 kb)
  • Visual Studio 2008 project + source code: vsts-php_azure.zip (218.19 kb)
  • Aug 6, 2009 at 5:40 PM

    Ooops, new error:

    • PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\ext\php_azure.dll' - The specified module could not be found. in Unknown on line 0
    • This application has failed to start because msshrt.dll was not found. Re-installing the application may fix this problem.

    Thanks!

    P.S.: I installed PHP from Web Platform Installer.

    Coordinator
    Aug 6, 2009 at 5:56 PM

    Are you using development fabric as a host or IIS? Anyways, this should fix it when running on IIS: copy C:\Program Files\Windows Azure SDK\v1.0\bin\devfabric\x86\msshrt.dll into C:\Program Files (x86)\PHP as well

    Aug 7, 2009 at 1:44 PM

    Cool!

    Thanks man, great job.

    Jan 8, 2013 at 9:39 AM

    I've downloaded and installed the library NTS on PHP 5.3 but I continue to receive "Call to undefined function azure_getconfig()"

    Does it work to someone?

    Thank you