[Laravel] Installing Laravel 8, Composer and PHP 8 on Ubuntu (20.04)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi in this video i'm going to show you how you can install php8 along with composer and then we can finally install laravel in order for us to get php 8.0 we need to add an additional repository because it's not available in the the ones that come bundle in ubuntu so first of all we need to ensure that we have the latest version of software approach common and also that we're just gonna go sudo apt apt install software properties common in many cases you'll see that this is already installed and that's just great next thing is we need to add the repository i talked about lastly and we do that by running sudo and then the add apt repository and then the repository and what this essentially does is that it tells the package manager will then want to look for packages outside of the official sources and what you're just going to add the pba android slash php and at this point you're just going to press enter and then we're going to have to run sudo apt update to refresh the sources list so the app update and perfect at this point we are ready to install php and we can do that by running the sudo apt install php 8.0 and this is going to take probably about 20 seconds or something like that depending on your computer and your network speed at this point we have php installed and we can verify that by running the php dash v command this is going to show us that we have php php 8.0 installed but we still need to install some extra extensions at least folder also function probably and those are sudo at install and we want php 8.0 mb string we want php 8.0 xml php 8.0 um mysql this is so that we can connect to mysql database then one php 8.0 girl which allows us to communicate using the curl command line and then we also want php 8.0 sip and we might not need that but it's good to have it anyway additionally if you want to also use another database such as postgres you can install that by running php 8.0 that's ptsql i'm not going to do that but if you want you can do it i'm gonna press enter and that's gonna install the packages that we need perfect so now we are essentially ready to install laravel but in order for us to install the url we need a package manager that is able to gather all the dependencies in this case the preferred solution is composer composer is much like node package manager or nougat or maven or gradle if you will it's of course a little bit different but you'll see that some similarities so in order for us to install them we need to go to getcomposer.org within here we go to the download section and we're just going to copy this real quick and once it's done we now have a file that's called composer.php and if we run that we get all the commands the problem is that you can only run it from within the directory directory that we're currently in and that's problematic because we need that you know elsewhere so in order for us to make global we can copy this command and it's just going to move this file and rename it onto the bin directory and let's do that real quick and if i type composer now you'll see that it works but i can do this anywhere yeah now so the next thing is that we actually ready to install laravel so we go on to firefox again or your browser of choice go to laravel.com documentation and then down here you'll see installation via composer and we can just copy this command this instructs composer to create a project of the laravel repository and then we can give it a name and i'll just call it a web demo and press enter this is also going to take a little while especially the first time because composer hasn't cached anything yet um so you're probably looking at 30 seconds so yeah once again depending on your both your computer and everything else and once it's done it's gonna do some extra things and we're basically done so let's see what's within our directory and we'll see that there's now a new directory called web demo so i'll change directory to web demo and let's see what's in here so within here we have a bunch of new files and yada yada the most important one right now is the artisan file artisan is the command line for laravel and it allows us to interact with our application through it if we type php and then artisan and we can press the tab key to finish like so we will get all the commands that we can use to interact with the current application we just created right now we don't need to worry about any of these but they're useful the only thing we're going to do now is we're going to use the let's see we're going to use the serve command and this is going to spin up a development so what we can use to start developing in laravel so we'll now see that laravel is running at localhost at on port 8000 and if i click on this we can now see that it's opened and here we have it laravel is installed and we're ready to develop we want to close this connection on the server we can press ctrl c and it's going to close it and we can verify that it's closed by going back to the browser and refreshing and you'll see that you can no longer connect to it i hope that helped you get started thank you for watching
Info
Channel: Niels Kjær Faurskov
Views: 1,076
Rating: undefined out of 5
Keywords:
Id: YsqTZfeo_jk
Channel Id: undefined
Length: 6min 33sec (393 seconds)
Published: Wed Sep 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.