question

RossSummerell-5703 avatar image
0 Votes"
RossSummerell-5703 asked ·

Installing Composer on Azure App Service

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

https://docs.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-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoffreyNURIT-4769 avatar image
0 Votes"
JoffreyNURIT-4769 answered ·

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!

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

bedge avatar image
0 Votes"
bedge answered ·

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.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RossSummerell-5703 avatar image
0 Votes"
RossSummerell-5703 answered ·

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://docs.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?



· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.