git clone <REPOSITORY_ADDRESS> laravel-sanctum-api
cd laravel-sanctum-api/
sudo apt update
sudo apt install php-sqlite3
sudo apt install php7.4-sqlite3
sudo systemctl restart apache2
# one-time command
sudo usermod -a -G www-data $USER
# setup ownerships/permissions
sudo chown -R $USER:www-data storage/ bootstrap/cache/
sudo chgrp -R www-data storage bootstrap/cache/
sudo chmod -R ug+rwx storage bootstrap/cache/
# setup SQLite file write permissions for avoiding this error:
# SQLSTATE[HY000]General Error: 8 attempt to write a readonly database
# NOTE: we will work on "database" folder, but not only on "database.sqlite" file
sudo chgrp -R www-data database/
chown -R $USER database/
# after this make sure you have appropriate permission/ownership
# for "database/database.sqlite" file
cd database/
stat -c "%a %n" *
ls -la