How to install Laravel

Laravel is the one of the most famous PHP web framework, Laravel is a free open-source php framework. Laravel framework is following model–view–controller architectural pattern and based on Symfony, lots of web application using Laravel.It is more secure and fast compared other PHP framework.Lets see how to install Laravel in cPanel

1) Connect to ssh

See How to connect to ssh command prompt using cPanel info

2) Create project directory and download Laravel files to that folder

How to install Laravel in cPanel step 2

3) Move to Laravell folder

 $ cd laravel
 

4) Install Composer

 
 $ composer install
 

How to install Laravel in cPanel step 3

if any version error follow below link

Issue with installing Composer

5) Change you 127.0.0.1 to server ip address

 $ vi vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php

 At the end of it you will find were they are configured:
     protected function getOptions()
    {
        return [
            ['host', null, InputOption::VALUE_OPTIONAL, 'The host address to serve the application on', '127.0.0.1'],
            ['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on', '8000'],
        ];
    }

 change 127.0.0.1 to YOUR_IP_ADDRESS and save the files
 


6) Open php artisan serve and generate key

  $ php artisan serve
  $ php artisan key:generate 
  $ php artisan cache:clear

7) open http://YOUR_IP_ADDRESS :8000/myblog/laravel/.env files and change database and server info

How to install Laravel in cPanel step 4

8) Open http://YOUR_IP_ADDRESS:8000/myblog/laravel/public/install to complete your installation

Features of Laravel

1 ) Template Engine : Laravel has a concept of using Blade Templating ,a templating engine to design a unique layout, All Blade templates should use the .blade.php extension.

2) Security : Most of the php framework facing security issues,but Laravel offers very strong security sytem.

3) Artisan : it is the name of the command line interface included with Laravel ,it has alot of usefull command to clear cache, generate key etc
. php artisan key:generate
. php artisan cache:clear
. php artisan config:cache

4) Database Migration System : Migrations are like version control for your database

5) Unit-Testing : Laravel support Unit-Testing

composer install error this package requires php 7.2 but your PHP version does not satisfy that requirement

If your are getting an error this package requires php 7.2 but your PHP version does not satisfy that requirement when trying to install composer $ composer install.you have to use below command to install composer in your system


composer update --ignore-platform-reqs

composer install error this package requires php 7.2 but your PHP version does not satisfy that requirement

How to connect to ssh command prompt using cPanel info

cPanel is the one of the most widely used server management software ,it has lot of good features to manage files ,manage database system ,mange software’s etc , but in some case we need ssh connection to install or run features software or program.In this section we will discuss how to connect to ssh command prompt using cPanel info

1) Open SSH Access From Security Section

How to connect to ssh command prompt using cPanel info step 1

2) Click Manage SSH Keys

3) Generate a new key

Use your own password

How to connect to ssh command prompt using cPanel info step 2

4) View Private Key

How to connect to ssh command prompt using cPanel info step 3

5) Convert the key to PPK format : Use same password you used for generating key

6) Open Putty Software ,add host name ,browse PPK key and connect (Install Putty software if not Installed )

How to connect to ssh command prompt using cPanel info step 4

7) Connect to ssh command prompt using cPanel info

How to connect to ssh command prompt using cPanel info step 5

Illuminate \ Database \ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user @’localhost’ (using password: YES) (SQL: select * from information_schema.tables where table_schema =

am getting Illuminate \ Database \ QueryException (1045) SQLSTATE[HY000] [1045] Access denied for user ‘dstories_lara19’@’localhost’ (using password: YES) (SQL: select * from information_schema.tables where table_schema = error in laravel
IlluminateDatabaseQueryException

1) open .env file from root directory and change database username and password

Add add database info and save

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=DATABASENAME
DB_USERNAME=USERNAME
DB_PASSWORD=PASSWORD