Search code examples
azureazure-web-app-serviceweb-deploymentazure-deployment

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


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 ...


Solution

  • The laravel-tasks project is four years old. That project requires Laravel 5.4 and PHP 5.6. Both are old. The current mainstream PHP version is 7.4. Laravel is version 8.

    The azure command is specifying PHP 7.2 which is not supported by the project.

    You will need to download the project to your local system, patch and update, and then deploy with the patched version. The error that you have is caused by incompatibilities with composer. You will need to run composer update which will fail.

    Unless you are experienced with Laravel and PHP pick a different project to learn from.