Newer Note: The Interoperability Team at Microsoft has annouced a new version of the Windows Azure SDK for PHP which contains a set of shiny new command line tools and has deprecated the Windows Azure PHP Command-line Tools project. This post is not valid for the SDK, however a config file of the same name will be edited with the new tools. See http://azurephp.interoperabilitybridges.com for documentation on the new SDK tools
Note: Upcoming versions of the Windows Azure PHP Command-line tools will probably have functionality to change this at build time. Please check the documentation at the following sites to see if your version has the option.
The Windows Azure PHP Command-line Tools does not currently have a way to change the operating system (OS) family for any given instance; however there is a way to do this, by “hacking” the command line tool. If you have not already read my post on Hacking the Windows Azure PHP Command-line Tools you should do so now to get an understanding of what is going on behind the scenes.
The OS family you use is controlled in the .cscfg file as a parameter to your ServiceConfiguration tag. Open the .cscfg file in your command line tools install and locate the ServiceConfiguration tag. Add the “osFamily” attribute and set it to the OS family you want. Save the changes and rebuild your app.
Example with a Windows Server 2008 R2 instance:
<ServiceConfiguration xmlns=”http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration” osFamily=”2″>
As of the time of this writing you have the following OS family choices:
- 1 – Windows Server 2008 SP2
- 2 – Windows Server 2008 R2
For more information on osFamily see: http://msdn.microsoft.com/en-us/library/ee758710.aspx#ServiceConfiguration
osVersion
Now would probably be a good time to set the osVersion attribute as well. osFamily controls which Windows Server edition you use and osVersion controls which Windows Azure Guest OS your VM uses. A generally good default is the asterisk (*) which will ensure you have the most up-to-date guest OS available.
Example:
<ServiceConfiguration xmlns=”http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration” osFamily=”2″ osVersion=”*”>
For more information on osVersion also see: http://msdn.microsoft.com/en-us/library/ee758710.aspx#ServiceConfiguration
Learn more about running PHP on Windows Azure at http://azurephp.interopbridges.com