Skip to content

Instantly share code, notes, and snippets.

@alimranahmed
Last active March 5, 2023 17:28
Show Gist options
  • Save alimranahmed/056890293b59b015ea1856bace95c6a9 to your computer and use it in GitHub Desktop.
Save alimranahmed/056890293b59b015ea1856bace95c6a9 to your computer and use it in GitHub Desktop.
Commands for setting up linux server for PHP Project
# Source1: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04
sudo apt update
sudo apt install -y apache2
sudo apache2 -v
sudo apt install -y mysql-server
sudo apt install -y php libapache2-mod-php php-mysql php-common php-cli php-common php-json php-opcache php-readline php-dom php-curl
php -v
sudo apt install -y composer
sudo apt install -y git
sudo apt install -y vim
echo "To see database user creation and permission see script's comments!";
## sudo mysql
## CREATE DATABASE database_name;
## CREATE USER 'operator_user'@'%' IDENTIFIED WITH mysql_native_password BY 'user@Passw0rd';
## GRANT ALL ON database_name.* TO 'operator_user'@'%';
## exit
echo "To setup virtual host, visit: https://github.com/alimranahmed/resources/blob/master/articles/2017_04_24_Setting%20up%20virtual%20host%20in%20Linux%20for%20Apache%20server.md"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment