There are few things we need for this tutorial.
PHP 7.2+ REF : https://www.chris-shaw.com/blog/installing-php-7.2-on-debian-8-jessie-and-debian-9-stretch Composer REF : https://getcomposer.org/doc/00-intro.md#downloading-the-composer-executable laravel
Okay , so we will start intall for php 7.2 ++ and below are the steps :-
#Adding Repo $ sudo apt-get install apt-transport-https lsb-release ca-certificates $ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg $ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list #Update and install php7.2 $ apt update $ apt-get install php7.2-fpm php7.2-mysql php7.2-xml php7.2-zip php7.2-mbstring php7.2-curl php7.2-gd
Next, we will learn how to install composer and use it globally
#Install the composer setup $ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" $ php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" $ php composer-setup.php $ php -r "unlink('composer-setup.php');" #Move the composer.phar to use it globally $ mv composer.phar /usr/local/bin/composer
Finally , we are going to install Laravel. After getting everything prepared , you can move to your desired path to start installing your laravel project. For my case i will install it @ /var/www/laravel/
$ mkdir /var/www/laravel/ $ cd /var/www/laravel/ #Laravel Installation - Might take a while to install $ composer global require "laravel/installer"