Here, we provide the steps to install Laravel manually via the command line (CLI) using either Composer or the Laravel Installer.
Laravel is a PHP web application framework designed to streamline and simplify the process of building robust and scalable websites and applications.
It provides developers with a set of tools and conventions that make common tasks, such as routing, database interaction, and templating, more straightforward.
Related Articles
Configure Laravel .htaccess
View Laravel Error Logs
Via Composer
NOTE: This initiates a default Laravel project.
-
SSH into the server
- Locate your site's document root
- Run the command
cd public_html
REPLACE: public_html with the site's document root. - Install Laravel
composer create-project laravel/laravel your_project_name
REPLACE: your_project_name with the project name. The Laravel installation will be in the /your_project_name folder.
NOTE: Laravel can be installed in the current directory usingcomposer create-project laravel/laravel
.
-
Create a redirect in the .htaccess to correct the loading location
TIP: Further configuration settings can be set through the .env file.
Via Laravel Installer
TIP: Laravel is also available to install using Softaculous.
NOTE: This installs the Laravel binaries, allowing you to swiftly initialize a new Laravel application by running laravel new project
.
-
SSH into the server
- Locate your site's document root
- Run the command
cd public_html
REPLACE: public_html with the site's document root.
- Install the Laravel Installer
NOTE: This installs the Laravel binaries, allowing you to swiftly initialize a new Laravel application by running a simple command.
- Run the command
composer global require laravel/installer --update-with-all-dependencies
- Add the binaries to .bashrc
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
- Activate the binaries
source ~/.bashrc
- Run the Installer
laravel new your_project_name
REPLACE: your_project_name with the project name. The Laravel installation will be in the your_project_name folder.
EXAMPLE:
[userna5@ecngx235 ~]$ cd public_html [userna5@ecngx235 public_html]$ composer global require laravel/installer --update-with-all-dependencies Changed current directory to /home/userna5/.config/composer ...... Running composer update laravel/installer --with-all-dependencies [userna5@ecngx235 public_html]$ echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' ~/.bashrc [userna5@ecngx235 public_html]$ source ~/.bashrc [userna5@ecngx235 public_html]$ laravel new myProject _ _ | | | | | | __ _ _ __ __ ___ _____| | | | / _` | '__/ _` \ \ / / _ \ | | |___| (_| | | | (_| |\ V / __/ | |______\__,_|_| \__,_| \_/ \___|_| ┌ Would you like to install a starter kit? ────────────────────┐ │ › ● No starter kit │
- Select a starter kit
TIP: More information on starter kits can be found in Laravel's documentation. - Respond to the installer prompts
- Run the command
-
Create a redirect in the .htaccess to correct the loading location
TIP: Further configuration settings can be set through the .env file.
Comments
0 comments
Article is closed for comments.