Last active
June 12, 2020 20:23
-
-
Save sakilimran/afca5d221d2bc618af709e51ee31b90d to your computer and use it in GitHub Desktop.
Environment Create For Laravel Development in Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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