PHP doesn't work when a default document root is changed.

Answered PHP doesn't work when a default document root is changed.

  • Thursday, March 08, 2012 4:14 AM
     
     

    Hi Everyone,

    I am looking for a way to change a default document root("%RoleRoot%\approot\") and to be operated PHP exactly.

    In HWC, the document root is unchangeable, it's not able to use. 
    In Full IIS, the document root can be changed by <sites> on .csdef, but PHP doesn't work because of the following error. 

    <handler> scriptProcessor could not be found in <fastCGI> application configuration

    A Handler is set up as follows. 

    <add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="%RoleRoot%\approot\php\php-cgi. exe" resourceType="Unspecified" /> 

    It seems to be unable to recognize "%RoleRoot%" when a webrole is worked as Full IIS. 
    I tried to set %RoleRoot% on an system environment variable using start-up task, but have no effect.

    If those who know the solution of this problem, please advise me.
    Of cource, if there is a method of changing a document root on HWC, it also no problem.

    Thank you for your consideration. 

All Replies

  • Thursday, March 08, 2012 8:03 AM
    Moderator
     
     

    Hi,

    Perhaps your try to use Azure SDK for PHP, it's more convinient for PHP developers, have a look at:

    http://phpazure.codeplex.com/ 

    Hope it can help you.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

  • Thursday, March 08, 2012 12:08 PM
     
     

    Hi Arwind,

    Thank you for your reply.

    But, to begin with, PHP cannot work on my Azure environment when the WebRole is set as "Full IIS" mode.

    Therefore, I think this SDK can't use...

    Sorry...

    Sincerely,

    hiromiku

  • Friday, March 09, 2012 7:01 AM
    Moderator
     
     Answered

    Hi,

    May I know what you want to achieve by "changing default root"? Do you encounter the same issue as the OP in the following thread?

    http://stackoverflow.com/questions/5796085/iis-document-root-in-subfolder

    If so you can use URL rewrite as the answerer mentioned.


    Allen Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked As Answer by hiromiku Thursday, March 15, 2012 9:29 AM
    •  
  • Thursday, March 15, 2012 9:29 AM
     
     

    Hi Allen,

    Thank you for your reply.

    Sorry, I could find a solution.

    I could be changed the document root and PHP also works.

    The solution is that after a setup of Full IIS, in the start-up task, corresponded to add handler of FastCGI to Web.config dynamically by using Appcmd.

    hiromiku