Skip to content

Instantly share code, notes, and snippets.

@zdk
Created November 5, 2024 14:05
Show Gist options
  • Save zdk/c495f501b62fefd5298ea937535733f2 to your computer and use it in GitHub Desktop.
Save zdk/c495f501b62fefd5298ea937535733f2 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Update system packages
apt-get update
apt-get upgrade -y
# Install Apache web server
apt-get install -y apache2
# Add PHP repository and install PHP 8.2
apt-get install -y software-properties-common
add-apt-repository -y ppa:ondrej/php
apt-get update
# Install PHP 8.2 and common extensions
apt-get install -y php8.2 \
php8.2-common \
php8.2-mysql \
php8.2-xml \
php8.2-xmlrpc \
php8.2-curl \
php8.2-gd \
php8.2-imagick \
php8.2-cli \
php8.2-dev \
php8.2-imap \
php8.2-mbstring \
php8.2-opcache \
php8.2-soap \
php8.2-zip \
php8.2-intl \
php8.2-dom \
php8.2-mysql \
zip \
unzip
# Configure PHP for Apache
apt-get install -y libapache2-mod-php8.2
a2enmod rewrite
systemctl restart apache2
systemctl enable apache2
cd /usr/bin && curl -sS https://getcomposer.org/installer | php && mv composer.phar composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment