Skip to content

Instantly share code, notes, and snippets.

@hasibomi
Last active October 19, 2022 08:53
Show Gist options
  • Save hasibomi/2c7fa0eb869a79ccfa121d2dd8bb5aaa to your computer and use it in GitHub Desktop.
Save hasibomi/2c7fa0eb869a79ccfa121d2dd8bb5aaa to your computer and use it in GitHub Desktop.
LAMP Stack installation script. It will work on linux environment & has been tested on Ubuntu 20.2. Download `lamp-stack.sh` file. & run `chmod 755 lamp-stack.sh` to make it executable.
#!/bin/sh
# Author: Hasibur Rahman Omi
# Email: me@hasibomi.com
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install curl
sudo apt-get -y install apache2
sudo apt-get -y install mysql-server
sudo apt-get -y install php8.1
sudo apt-get -y install php8.1-fpm
sudo apt-get -y install php8.1-mysql
sudo apt-get -y install php8.1-curl
sudo apt-get -y install php8.1-simplexml
sudo apt-get -y install php8.1-mbstring
sudo apt-get -y install php8.1-gd
sudo apt-get -y install php8.1-imap
sudo apt-get -y install php8.1-cli
sudo a2enmod rewrite
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.1-fpm
sudo systemctl restart apache2
# Install composer (https://getcomposer.org/)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
# Install wpcli (http://wp-cli.org/)
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
# Install other programs
sudo apt-get install -y zip
@hasibomi
Copy link
Author

Updated to PHP 7.4

@hasibomi
Copy link
Author

Updated to PHP 8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment