I use a startup script to install PHP, normallay I would use the default script of the PHPAzure SDK, which installs the newest available version, but I need absolutely PHP v5.3.8.
So I wrote my own install script (which I use instead of install-php.cmd):
@ECHO ON
SET PHP_FULL_PATH=%~dp0PHP\v5.3\php-cgi.exe
SET NEW_PATH=%PATH%;%RoleRoot%\base\x86
%WINDIR%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='%PHP_FULL_PATH%',maxInstances='12',idleTimeout='60000',activityTimeout='3600',requestTimeout='60000',instanceMaxRequests='10000',protocol='NamedPipe',flushNamedPipe='False']" /commit:apphost
%WINDIR%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='%PHP_FULL_PATH%'].environmentVariables.[name='PATH',value='%NEW_PATH%']" /commit:apphost
%WINDIR%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='%PHP_FULL_PATH%'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']" /commit:apphost
%WINDIR%\system32\inetsrv\appcmd.exe set config -section:system.webServer/handlers /+"[name='PHP',path='*.php',verb='GET,HEAD,POST',modules='FastCgiModule',scriptProcessor='%PHP_FULL_PATH%',resourceType='Either',requireAccess='Script']" /commit:apphost
%WINDIR%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /"[fullPath='%PHP_FULL_PATH%'].queueLength:50000"
The problem is, that I'm not very familiar with writing startup scripts.
And I now have the problem that after deploying the package the PHP handler path is completely wrong, it always points to a temporary build path somewhere on my local dev machine instead of taking the path relative to the recent approot.
Maybe you can help me with configuring this script with the correct parameters?
The correct path to my custom PHP installation is:
approot/bin/PHP/v5.3/php-cgi.exe