Over a million developers have joined DZone.

PHP 5.4 Available in Windows Azure Web and Worker Roles

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

One of the things that may have slipped past you in the holiday madness was this: PHP 5.4 is available in Windows Azure Web and Worker Roles. This is just a quick post to bring you up to speed on this feature. (If you are wondering about PHP versions in Windows Azure Web Sites, see PHP 5.4 available in Windows Azure Web Sites.)

With the latest Windows Azure SDK for PHP, you can use PowerShell cmdlets to create a Windows Azure project, add PHP web and worker roles, and now, specify the version of PHP to be used in the roles…including PHP 5.4. Here are the steps to creating a project and selecting a specific version of PHP (more details are in this article: How to create PHP web and worker roles):

1. Create an Azure project:

    New-AzureServiceProject projectName

2. Add a PHP Web or Worker role:

Add-AzurePHPWebRole roleName

- OR -

Add-AzurePHPWorkerRole roleName

3. Specify the PHP version to be used in the role (the currently available versions are 5.3.17 or 5.4.0):

    Set-AzureServiceProjectRole roleName php 5.3.17

- OR -

    Set-AzureServiceProjectRole roleName php 5.4.0

That’s it. However, note that currently you can only choose from two versions of PHP: 5.3.17 and 5.4.0. The team in charge of supporting PHP in web and worker roles is working hard to make several versions of PHP available in the near future. To see what versions are available, use the Get-AzureServiceProjectRoleRuntime cmdlet:

    PS C:\MyProject> Get-AzureServiceProjectRoleRuntime

At the time of this writing, here’s what you will see (note the IsDefault flag is set to true for PHP 5.3.17, indicating that it will be the default PHP version installed):

    Runtime    : Node
    Version    : 0.6.17
    PackageUri : http://nodertncu.blob.core.windows.net/node/0.6.17.exe
    IsDefault  : False

    Runtime    : Node
    Version    : 0.6.20
    PackageUri : http://nodertncu.blob.core.windows.net/node/0.6.20.exe
    IsDefault  : True

    Runtime    : Node
    Version    : 0.8.4
    PackageUri : http://nodertncu.blob.core.windows.net/node/0.8.4.exe
    IsDefault  : False

    Runtime    : IISNode
    Version    : 0.1.21
    PackageUri : http://nodertncu.blob.core.windows.net/iisnode/0.1.21.exe
    IsDefault  : True

    Runtime    : Cache
    Version    : 1.8.0
    PackageUri : http://nodertncu.blob.core.windows.net/cache/1.8.0.exe
    IsDefault  : True

    Runtime    : PHP
    Version    : 5.3.17
    PackageUri : http://nodertncu.blob.core.windows.net/php/5.3.17.exe
    IsDefault  : True

    Runtime    : PHP
    Version    : 5.4.0
    PackageUri : http://nodertncu.blob.core.windows.net/php/5.4.0.exe
    IsDefault  : False


After you have selected your PHP version,  you can customize the it (change configuration settings and enable/disable extensions).  Or, you can provide your own PHP runtime. These articles will show you how:

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.


Published at DZone with permission of Brian Swan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}