Recall & Review
beginner
What is Composer in PHP?
Composer is a tool for managing PHP project dependencies. It helps you install and update libraries your project needs.
Click to reveal answer
beginner
How do you check if Composer is installed on your system?
Run the command
composer --version in your terminal. If Composer is installed, it shows the version number.Click to reveal answer
beginner
What is the first step to install Composer on Windows?
Download the Composer-Setup.exe from the official Composer website and run it. It guides you through the installation.
Click to reveal answer
intermediate
How do you install Composer globally on Linux or macOS?
Use these commands:<br>
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"<br>php composer-setup.php<br>php -r "unlink('composer-setup.php');"<br>Then move it to a directory in your PATH, e.g., sudo mv composer.phar /usr/local/bin/composer.Click to reveal answer
beginner
What file does Composer use to manage project dependencies?
Composer uses a
composer.json file in your project folder to list the libraries and versions your project needs.Click to reveal answer
Which command checks the installed Composer version?
✗ Incorrect
The command
composer --version shows the installed Composer version.What is the main purpose of Composer in PHP projects?
✗ Incorrect
Composer manages libraries and packages your PHP project depends on.
Where is the
composer.json file located?✗ Incorrect
The
composer.json file is placed in the root folder of your PHP project.Which command installs the dependencies listed in
composer.json?✗ Incorrect
The
composer install command downloads and installs all dependencies.On Windows, how do you start installing Composer?
✗ Incorrect
On Windows, you download and run the Composer-Setup.exe installer.
Explain the steps to install Composer globally on Linux or macOS.
Think about commands to download, run, clean up, and move the Composer file.
You got /4 concepts.
Describe the role of the composer.json file in a PHP project.
Consider how Composer knows what packages to install.
You got /4 concepts.