Created
August 9, 2020 00:44
-
-
Save samlovescoding/f5acdbb19b49e84eac44d68cf02f1a06 to your computer and use it in GitHub Desktop.
Actually working Linux setup for PHP and MySQL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update your system and its repositories | |
sudo apt-get update | |
sudo apt-get upgrade | |
# Install Apache Server | |
sudo apt-get install apache2 | |
# Install MySQL Server | |
sudo apt-get install mysql-server | |
mysql_secure_installation | |
# Validate Password: n | |
# New Password: 123456 | |
# Re Enter Password: 123456 | |
# Remove anonymous users: y | |
# Disallow root login remotely: y | |
# Remove test database and access to it: n | |
# Reload privileges table: y | |
# Install PHP | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get install php libapache2-mod-php php-mysql | |
# Setup MySQL root user | |
sudo mysql | |
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345678'; | |
# Fix directory permissions | |
chown -R samlovescoding:samlovescoding /var/www | |
chmod -R 755 /var/www | |
# Put index.php before index.html if you want Apache2 to load index.php before index.html file. | |
sudo nano /etc/apache2/mods-enables/dir.conf | |
sudo service apache2 restart | |
# Install other PHP modules. Feel free to list your favorite modules. I'll add them if I feel they are common. | |
sudo apt-get install php-curl php-mbstring php-mcrypt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not a script you can download and run. Run each command one by one!
MySQL username: root
MySQL password: 12345678