How to install laravel Globally on Ubuntu

How to install laravel Globally on Ubuntu

Introduction

Laravel uses composer to run and create projects,before proceeding with this install,please ensure you have composer install globally,is not you must first install from their official page?here.

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Open your terminal by using?Ctrl+Alt+T?and type the following commands.


Step 1 : Laravel installation

composer global require "laravel/installer"        


Step 2 : Add composer to path .bashrc file to access laravel globally

cd ~
sudo nano .bashrc        


Step 2(i): Edit environment config path file and by adding this line

export PATH="$PATH:$HOME/.config/composer/vendor/bin"        


Step 2(ii) :Hot Reload config path

source ~/.bashrc        


Step 3 : Create a new Laravel application

laravel new mail        


Step 4 : Install missing composer packages and their dependencies

cd mail
composer install && composer update        


Step 5: Test the application

Open the application using your favorite IDE i.e?PHPstorm?or?code

php artisan serve        


Step 6: Stop server afterwards.

You have successfully installed and tested laravel globally.Well done. Terminate?php server?in terminal by pressing =>

Ctrl+C        

#Wambua

Abel Zeleke

Bachelor of Science in Software Engineering

6 个月

This was very helpful, thank you

回复
Onyango Samuel

Front-End Developer

1 年

Thank you, this was helpful

回复

要查看或添加评论,请登录

Patrick W.的更多文章

社区洞察

其他会员也浏览了