Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save parallaxhub/bb7f56c2af328a21fac28637ba8ad305 to your computer and use it in GitHub Desktop.
Save parallaxhub/bb7f56c2af328a21fac28637ba8ad305 to your computer and use it in GitHub Desktop.
Install Different PHP Version and Switch PHP Version
#!/bin/bash
# Installing PHP Versions 7.2 and 7.3 with PHP-FPM
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update -y
sudo apt-get install php7.2 php7.2-fpm php7.2- libapache2-mod-php7.2 libapache2-mod-fcgid -y
sudo apt-get install php7.3 php7.3-fpm php7.3- libapache2-mod-php7.3 -y
sudo systemctl start php7.2-fpm
sudo systemctl status php7.2-fpm
sudo systemctl start php7.3-fpm
sudo systemctl status php7.3-fpm
# SWITCH PHP VERSION
update-alternatives --config php
# Configure PHP.INI
nano /etc/php/7.3/apache2/php.ini
file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 1024M
upload_max_filesize = 1024M
max_execution_time = 3600
date.timezone = UTC+6
# ctrl+s and ctrl+x
apt update -y
apt upgrade -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment