install php
$sudo apt install zip unzip software-properties-common
$sudo add-apt-repository ppa:ondrej/php
$sudo apt install -y php8.0 php8.0-gd php8.0-mbstring php8.0-xml php-zip
Apache2
$sudo apt install apache2 libapache2-mod-php8.0
MySQL
$sudo apt install mysql-server php8.0-mysql
(optional) Upgrade composer 2.0
$sudo apt install curl
$curl -sS https://getcomposer.org/installer -o composer-setup.php
$sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Laravel installer
$composer global require laravel/installer
Edit Laravel path
$cd~
$nano .bashrc
add export PATH=$PATH:$HOME/.config/composer/vendor/bin
to last line
$source ~/.bashrc
create & run project
$laravel new {project name}
$php artisan serve
open http://127.0.0.1:8000 on browser
(optional) VScode
$sudo snap install --classic code
Top comments (0)