Skip to content

Commit a477928

Browse files
committed
Added the switch to PHP7.3 version.
1 parent dfb27b5 commit a477928

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Once setup is complete, you can easily switch between different PHP versions usi
5858
./switch-to-php-7.1.sh
5959
./switch-to-php-7.2.sh
6060
./switch-to-php-7.3.sh
61+
./switch-to-php-7.4.sh
6162
```
6263

6364
This will alter the versions of PHP running in Apache and the command line. Your password will be required to enable/disable Apache modules, restart the web server and alter the default PHP CLI version.

setup.sh

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ sudo apt-get install -y php7.3 php7.3-common php7.3-cli > /dev/null
4242
echo "* Installing PHP 7.3 extensions..."
4343
sudo apt-get install -y php7.3-bz2 php7.3-curl php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-readline php7.3-soap php7.3-sqlite3 php7.3-tidy php7.3-xml php7.3-xsl php7.3-zip > /dev/null
4444

45+
echo "* Installing PHP 7.4..."
46+
sudo apt-get install -y php7.4 php7.4-common php7.4-cli > /dev/null
47+
48+
echo "* Installing PHP 7.4 extensions..."
49+
sudo apt-get install -y php7.4-bz2 php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-soap php7.4-sqlite3 php7.4-tidy php7.4-xml php7.4-xsl php7.4-zip > /dev/null
50+
4551
echo "* Installing additional PHP extensions..."
4652
sudo apt-get install -y php-memcache php-memcached php-redis > /dev/null
4753

switch-to-php-7.4.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
echo "* Disabling Apache PHP 5.6 module..."
4+
sudo a2dismod php5.6 > /dev/null
5+
6+
echo "* Disabling Apache PHP 7.0 module..."
7+
sudo a2dismod php7.0 > /dev/null
8+
9+
echo "* Disabling Apache PHP 7.1 module..."
10+
sudo a2dismod php7.1 > /dev/null
11+
12+
echo "* Disabling Apache PHP 7.2 module..."
13+
sudo a2dismod php7.2 > /dev/null
14+
15+
echo "* Disabling Apache PHP 7.3 module..."
16+
sudo a2dismod php7.3 > /dev/null
17+
18+
echo "* Enabling Apache PHP 7.4 module..."
19+
sudo a2enmod php7.4 > /dev/null
20+
21+
echo "* Restarting Apache..."
22+
sudo service apache2 restart > /dev/null
23+
24+
echo "* Switching CLI PHP to 7.4..."
25+
sudo update-alternatives --set php /usr/bin/php7.4 > /dev/null
26+
27+
echo "* Switch to PHP 7.4 complete."

0 commit comments

Comments
 (0)