Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Rasoul-Esmaeili/91e92b986bcfc724484e58e74a62dded to your computer and use it in GitHub Desktop.
Save Rasoul-Esmaeili/91e92b986bcfc724484e58e74a62dded to your computer and use it in GitHub Desktop.
Install Laravel On All OS
########## Install Laravel on Mac
brew install php@8.3
brew install composer
# Install laravel
composer create-project laravel/laravel rasoul-project
cd rasoul-project
php artisan serve
# Install with Laravel installer
composer global require laravel/installer
export PATH=~/.composer/vendor/bin:$PATH
laravel new rasoul-project
# Install with docker composer image
docker run --rm --interactive --tty --volume $PWD:/app composer composer create-project laravel/laravel rasoul-project
cd rasoul-project
docker run --rm --interactive --tty --volume $PWD:/app -p 8000:8000 composer php artisan serve --host=0.0.0.0
# ----------------------------------------------------------------------------------------------------------------------- #
########## Install on ubuntu / windows WSL
# Install PHP
sudo apt install openssl php8.3-bcmath php8.3-curl php8.3-cli php8.3-mbstring php8.3-mysql php8.3-tokenizer php8.3-xml php8.3-zip php8.3-mysql
# Install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
# Install laravel
composer create-project laravel/laravel rasoul-project
cd rasoul-project
php artisan serve
# ----------------------------------------------------------------------------------------------------------------------- #
# Install on windows
# use wsl and install same as ubuntu
# use Xampp
# use herb
# ----------------------------------------------------------------------------------------------------------------------- #
# ----------------------------------------------------------------------------------------------------------------------- #
#Remove PHP, Composer from Ubuntu
sudo apt purge php8.3*
sudo -rf /usr/local/bin/composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment