In this tutorial I will discuss how to install composer and laravel, for the laravel version I use is laravel 9. before installing laravel we must install composer first, here I try to describe the steps in installing composer and laravel version 9, good luck.
Table of contents :
- Definition composer and laravel
- System Requirements
- install composer
- install laravel
- Closing
- DEFINITION COMPOSER AND LARAVEL
1.1 Definition of Composer
According to the official website, https://getcomposer.org/ “Composer is a tool for dependency management in PHP.” So composer is a dependency management tool in PHP.
Composer makes it easy for you to create libraries in your PHP projects and composer itself will install or update automatically without having to install them manually.
You can download the file on the official website here
1.2 Definition of Laravel
According to their official website, https://laravel.com/. “Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.”
So Laravel is a PHP-based web application framework that is open source and widely used for fast and easy web application design.
2. SYSTEM REQUIREMENTS
2.1 System Requirements for Composer
Composer requires PHP 5.3.2+ to run. Composer is multi-platform and runs equally well on Windows, Linux, and macOS.
2.2 System Requirements for laravel
Laravel requires PHP version 5.4 and above, Mcrypt PHP Extension, OpenSSL PHP Extension, Mbstring PHP Extension, Tokenizer PHP Extension.
3. COMPOSER INSTALLATION
Run Composer-Setup.exe which you downloaded earlier as shown below:
after that click next and you will be asked to choose the folder where php.exe is located, because I use XAMMP so the location of the php.exe file is in C:\xammp\php\php.exe as shown below
Next, you will be asked to set the proxy as shown below
Next, you are asked to confirm all the settings before the installation process begins, as shown below
Next, Please wait after the installation process finish
If the installation process is successful, the following image will appear
Next, after the Composer installation process is complete, the next step is to check the Composer installation using the Command Prompt. The trick is to press Win + R then type cmd and click Ok. then enter the command “composer” if the composer installation process is successful it will appear as shown below
4. LARAVEL INSTALLATION
I assume you have XAMPP installed, then run CMD and move the directory to xampp/htdocs,
Furthermore, if you have entered the htdocs directory, you must make a request to retrieve (and install) the Laravel files that have been provided in the Github repository. Use this command to make a request:
composer create-project –prefer-dist laravel/laravel your_project_name
like the picture below
To ensure that Laravel is successfully installed and ready to use, navigate to Command Prompt or Terminal to the directory you created earlier. Then, enter the following command into Command Prompt or Terminal:
“php artisan serve”
If it says Laravel development server started in the Command Prompt or Terminal, the next step is to open the link provided by Laravel. By default, you will be directed to the server address, which is 127.0.0.1:8000. Later, a homepage will appear with Laravel writing in the middle as shown in the image below:
5. CLOSING
Congratulations, you have successfully installed composer and laravel.