Skip to content

Instantly share code, notes, and snippets.

@sakilimran
Last active June 12, 2020 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakilimran/afca5d221d2bc618af709e51ee31b90d to your computer and use it in GitHub Desktop.
Save sakilimran/afca5d221d2bc618af709e51ee31b90d to your computer and use it in GitHub Desktop.
Environment Create For Laravel Development in Ubuntu
# Tested
# Ubuntu 20.04
# PHP 7.4.3
# install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
# make composer globally accessible
mv composer.phar /usr/local/bin/composer
# check composer
composer
# download laravel installer using composer
composer global require laravel/installer
# place Composer's system-wide vendor bin directory in your $PATH
# first check $PATH
echo $PATH
# write the new $PATH into '.bashrc'
echo 'PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
# reload $PATH config
source .bashrc
# check $PATH again
echo $PATH
# laravel new command will create a fresh Laravel installation in the directory you specify
laravel new blog
# If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application. Go to the project directory and run:
php artisan serve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment