Installing Composer on Azure App Service

Ross Summerell 1 Reputation point
2019-12-18T09:26:06.15+00:00

Hi guys, new to Azure and testing it out to see if its worth using, I started here

https://learn.microsoft.com/en-us/azure/app-service/app-service-web-get-started-php

Which worked great, I then tried to upload my own Laravel App to test, however my APP needs Composer to install dependencies.

I found many articles but the two below sum up what I did

https://stackoverflow.com/questions/35035504/how-to-install-composer-on-app-service or

https://www.youtube.com/watch?v=mJzgzs6nGyQ

However, even though the Extension is successfully installing (Composer), when going Advance Tools - > CMD and typing Composer I get this

'composer' is not recognized as an internal or external command,
operable program or batch file.

I've then been talking to the support which has been very helpful who linked this article below but sadly that has not got it working either

https://social.msdn.microsoft.com/Forums/azure/en-US/6d54c43d-85a6-46fb-aa04-0794f81d0b9b/how-to-installverify-composer-from-web-app-extensions?forum=windowsazurewebsitespreview

Can anyone help?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,194 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Joffrey NURIT 211 Reputation points MVP
    2019-12-18T22:01:33.837+00:00

    Hi Ross,

    The first question are: what is the OS of your app service?

    The topic you found in https://stackoverflow.com/questions/35035504/how-to-install-composer-on-app-service has a good solution.
    You need to connect to your app service, in SSH if its Linux or in PowerShell if windows (use KUDU, it's more simple).
    Composer is a binary who works with PHP. Your app service need to be configure for PHP.
    After that, you can:

    • download forLinux the installer php file, for windows the composer.bat (you can download it on the machine OR copy the file with FTP)
    • Execute the file (php installer on Linux / composer.bat on windows)

    The process was described here: https://getcomposer.org/doc/00-intro.md#manual-installation

    Hope it helps!

    0 comments No comments

  2. Emerson Caro 86 Reputation points
    2019-12-19T02:17:43.213+00:00

    Hi,

    To install Composer, go to your App Service > Extensions > Add and choose Composer.

    After installing, you can see it on the SiteExtensions folder under the root folder of the machine where your application is hosted.

    0 comments No comments

  3. Ross Summerell 1 Reputation point
    2019-12-19T08:16:00.09+00:00

    Thanks both of you for the feedback,

    Again I am new to Azure, I am running PHP 7.3 stack.

    I am guessing Windows is the OS? I have not picked any OS' during the set up following this
    https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-php-mysql,

    But I have been using PowerShell.

    As a somewhat work around, I moved the composer.bat and .phar files from the siteExtenstions/ComposerExtentions/Commands to my site/wwwroot and then was able to run composer in cmd

    So it seems the problem is that it wont install composer globally?

    0 comments No comments