Over a million developers have joined DZone.
Platinum Partner

PHP 5.4 Available in Windows Azure Web and Worker Roles

· Cloud Zone

The Cloud Zone is brought to you in partnership with Mendix. Better understand the aPaaS landscape and how the right platform can accelerate your software delivery cadence and capacity with the Gartner 2015 Magic Quadrant for Enterprise Application Platform as a Service.

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:

The Cloud Zone is brought to you in partnership with Mendix.  Learn more about The Essentials of Digital Innovation and how it needs to be at the heart of every organization.


Published at DZone with permission of Brian Swan , DZone MVB .

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}