i got this error when i tried to git push | [ErrorException] : composer failed

Simodev 1 Reputation point
2021-08-07T23:01:39.013+00:00

I have been following this tutorial (Tutorial: Build a PHP and MySQL app in Azure App Service) https://learn.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app?pivots=platform-linux#deploy-to-azure

the problem is when i try to git push git push azure master
i get this error.

remote: Loading composer repositories with package information  
remote: Installing dependencies (including require-dev) from lock file  
remote:  
remote:  
remote: An error has occurred during web site deployment.  
remote:   [ErrorException]  
remote: composer failed  
remote:   "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?  
remote:  
remote:  
remote: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...  
remote:  
remote: Deployment Logs : 'https://larave-tasks.scm.azurewebsites.net/newui/jsonviewer?view_url=/api/deployments/dae345ee76d1755cfccd62004c6fc0c472fed981/log'  
To https://larave-tasks.scm.azurewebsites.net/larave-tasks.git  
 * [new branch]      master -> master  
  

Can someone help me solve this error ...

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,961 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2021-08-09T20:11:04.067+00:00

    Thanks for the sharing the Azure docs and the steps that you're referring to. Just to isolate the issue, kindly try the following steps:

    If you haven’t done this already, Access the log stream - You can also inspect the log files in a browser at https://<app-name>.scm.azurewebsites.net/api/logs/docker
    Also, review - http://sitename.scm.azurewebsites.net/deploymentlogs/ logs.

    Just to highlight , App Service Linux uses Oryx to build/install packages for PHP by default. To understand how Oryx works go to our App Service Linux Deploy Oryx -
    The PHP toolset is run when a composer.json file exists in the root of the repository.
    Are you leveraging custom script?

    Test the app locally in production mode.
    Review -depending on your composer.json, different packages may be installed for production mode (require vs. require-dev (in your case))

    Run your app in App Service in debug mode.
    For Laravel, you can configure your app to output debug messages in production by setting the APP_DEBUG app setting to true on Azure Portal.

    Ensure that the branch is not locked.
    Since your Git repository is in main branch, you may set the default deployment branch for your App Service app to main and test.

    Kindly let us know, we will follow-up with you further.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.