- install php
sudo apt install php php-cli php-mbstring php-xml php-zip php-mysql php-json
- install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
- create laravel project
composer create-project --prefer-dist laravel/laravel my-laravel-app
cd my-laravel-app
php artisan migrate
php artisan serve
- xampp
-download xampp
- make it executable
chmod +x xampp-linux-x64-8.2.12-0-installer.run
- run installer
sudo ./xampp-linux-x64-8.2.12-0-installer.run
- start
sudo /opt/lampp/lampp start
- move laravel app to /opt/lampp/htdocs/
- set correct permission
sudo chown -R www-data:www-data /opt/lampp/htdocs/my-laravel-app/storage
sudo chown -R www-data:www-data /opt/lampp/htdocs/my-laravel-app/bootstrap/cache
sudo chmod -R 775 /opt/lampp/htdocs/my-laravel-app/storage
sudo chmod -R 775 /opt/lampp/htdocs/my-laravel-app/bootstrap/cache
- configure virtual host
sudo nano /opt/lampp/etc/httpd.conf
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
sudo nano /opt/lampp/etc/extra/httpd-vhosts.conf
- at the end of this file add
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/my-laravel-app/public"
ServerName laravel-app.local
<Directory "/opt/lampp/htdocs/my-laravel-app/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
- add virtual host to host file
sudo nano /etc/hosts
127.0.0.1 laravel-app.local
- copy .env.example to .evn file
- generate application key
sudo /opt/lampp/bin/php artisan key:generate
- set correct ownership
sudo chown -R daemon:daemon /opt/lampp/htdocs/my-laravel-app/storage /opt/lampp/htdocs/my-laravel-app/bootstrap/cache
- set correct permission
sudo chmod -R 775 /opt/lampp/htdocs/my-laravel-app/storage /opt/lampp/htdocs/my-laravel-app/bootstrap/cache
- test application