Simple steps to use when setting up Laravel environment for PHP
$ sudo apt install php7.2-cli
$ sudo apt-get install php-mbstring
$ sudo apt-get install php-xml
$ sudo apt install php7.2-bcmath
This is what will be managing your php dependencies for your application, run the 4 commands in the link respectively for this purpose.
(https://getcomposer.org/download/)
To confirm if composer has been installed run the following to check composer version
$ composer
If you get an error stating that 'composer command not found', run the following command:
$ chmod +x composer.phar
$ nano ~/.bashrc
export PATH="$PATH:$HOME/.composer/vendor/bin"
$ source ~/.bashrc
$ sudo apt-get update
$ sudo apt-get install apache2
$ cd /var/www/html
$ sudo apt-get install php7.2-zip
$ composer global require laravel/installer
$ laravel new blog
or
$ composer create-project --prefer-dist laravel/laravel blog
then finally
$ cd blog
$ php artisan serve