Enforce Azure to use my PHP version

Jan 24, 2012 at 10:18 AM

How can I tell Azure to take my PHP version within the package?

I noticed that even if I put the whole 5.3.8 PHP package into my WebRole, after the deployment I have PHP 5.3.9 on the instances.

And the other thing is that Azure (or the startup tasks) is adding some extensions to the php.ini which I haven't set up.

(In my local program files folder I also have 5.3.8 installed).

Jan 24, 2012 at 1:23 PM

It sounds to me like you may be using the default scaffold and simply copying your PHP install into the php folder. Is this correct? The problem here is that the scaffold is setup to use the Web Platform Installer to install PHP dynamically into your Windows Azure instance. The php folder is only actually for customizing php.ini settings and adding additional PHP modules, you cannot actually replace PHP through that (though it may be something to think about). Check out this tutorial for how to get your own custom PHP install used


Also, are you using environment variables such as RoleRoot? If so I will need to dig around the default scaffold a bit and come up with the bits of it you will need to get those into your custom install.


Jan 24, 2012 at 2:57 PM

Your're right with the scaffolder. That the scaffolder startup scripts are using the Web Platform Installer is new to me, but it explains why the instance has a different version than my local env. The problem is that with the new PHP 5.3.9 I get an ugly fast-cgi error.

The tutorial seams to explain what I need, but is it not possible to modify the scaffold startup script with less efford to use the custom PHP? I'll first try it this way.

By the way, is it not possible to tell the installer which version to install?

Jan 24, 2012 at 3:07 PM

I found an install log entry within the bin folder:

Could not run Webpicmdline with Administrative priveleges. Please make sure you have Admin rights on this Machine.

Do you know how I can configure my package to get the needed rights?

Jan 30, 2012 at 6:07 PM


Are you setting the execution context to "elevated" in the .csdef file?

<Task commandLine="install-php.cmd" executionContext="elevated" taskType="simple" >


Jan 30, 2012 at 6:34 PM

HI Brain, yes it's elevated. I already found a solution. It's discribed here: http://blog.itopia.de/windows-azure-custom-php-installation/366