Skip to content

PRABAWEB

Programming Blog – Tutorials about Angular, ReactJS, NodeJS, PHP, MySQL and Web Development

  • Home
  • Tutorials
  • About Me
  • React Js
  • Toggle search form

What is Composer and how to install?

Posted on October 16, 2022October 16, 2022 By praba_tutor No Comments on What is Composer and how to install?

Hi there, I am going to explain about composer and installation.
What is a composer?
Composer is a dependency manager for PHP web applications. Composer is used in all modern PHP frameworks (Symfony, Laravel, Codeigniter, Yii and so on) and is one of the most recommended tools that solve fundamental issues in the majority of web projects.

This article will guide you through basic composer usage and advanced usage for a team environment. It will also explain what you need to change in your deployment process after integrating the composer.

The dependencies for all the PHP packages are installed automatically to reduce the workload of the developers.
composer install:
Go to https://getcomposer.org/doc/00-intro.md and download .exe file .
Once you have installed composer on your system, you can check using composer on your command prompt

1.If composer.lock does exist.
    Processes and installs dependencies from the composer.lock file.
2.If composer.lock does not exist.
    Process package installs from composer.json.
    Creates the composer.lock file based on the installed packages.

The install command reads the composer.lock file from the current directory processes it and downloads and installs all the libraries and dependencies outlined in that file. If the file does not exist it will look for composer.json and do the same.

Composer solves the following problems:

  • dependency resolution for PHP packages
  • autoloading solution for PHP packages
  • keeping all packages updated

composer update
Processes dependencies from the composer.json file (installs, updates and removes).
Creates or updates the composer.lock file according to the changes.

The update command reads the composer.json file from the current directory, processes it, and updates, removes or installs all the dependencies.

PHP Tags:php

Post navigation

Previous Post: PHP OOPS Interview questions and answers for freshers and experienced professionals
Next Post: PHP JWT Token Based Authentication

Related Posts

PHP logical programs for Freshers and Experienced Professionals PHP
PHP JWT Token Based Authentication PHP
PHP OOPS Interview questions and answers for freshers and experienced professionals PHP
Tips to Optimize Your PHP Script for Better Performance for Developers PHP

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • PHP
  • reactjs
  • Symfony

Copyright © 2023 PRABAWEB.

Powered by PressBook Media WordPress theme