To use composer, you need to connect to the server via SSH or go to Terminal in cPanel. For information on SSH access and using the Terminal, see article.
In this article we will be entering commands in the terminal built into the panel.
By default composer is installed on all shared hosting servers, for example to see the version of composer you can use command.
Creating a project in Laravel
To create a new project in Laravel, we first create a new project using composer.
Go to the public_html folder
Create a new project
composer create-project --prefer-dist laravel/laravel laravel-test.com
Replace laravel-test.com from the example with the folder name you need for the new project.
Important: for Laravel, when specifying the path to the site root directory at the domain creation stage, you must specify the directory project_folder/public, rather than using the default option - domain_name**
Next, specify the php version for the created domain at least 7.1, this is the minimum requirement for Laravel version 5.7, which we use in this guide.
Let's check the created project in a browser.