Skip to content

Added PHP 7.3 version #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Once setup is complete, you can easily switch between different PHP versions usi
./switch-to-php-7.0.sh
./switch-to-php-7.1.sh
./switch-to-php-7.2.sh
./switch-to-php-7.3.sh
```

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.
Expand Down
10 changes: 8 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ echo "* Installing PHP 7.2..."
sudo apt-get install -y php7.2 php7.2-common php7.2-cli > /dev/null

echo "* Installing PHP 7.2 extensions..."
sudo apt-get install -y php7.2-bz2 php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-soap php7.2-sqlite3 php7.2-tidy php7.2-xml php7.2-xsl php7.2-zip php-redis > /dev/null
sudo apt-get install -y php7.2-bz2 php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-soap php7.2-sqlite3 php7.2-tidy php7.2-xml php7.2-xsl php7.2-zip > /dev/null

echo "* Installing PHP 7.3..."
sudo apt-get install -y php7.3 php7.3-common php7.3-cli > /dev/null

echo "* Installing PHP 7.3 extensions..."
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

echo "* Installing additional PHP extensions..."
sudo apt-get install -y php-memcache php-memcached > /dev/null
sudo apt-get install -y php-memcache php-memcached php-redis > /dev/null

echo "* Setup complete. You may now use the 'switch-to-php-*.*.sh' scripts."
3 changes: 3 additions & 0 deletions switch-to-php-5.6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ sudo a2dismod php7.1 > /dev/null
echo "* Disabling Apache PHP 7.2 module..."
sudo a2dismod php7.2 > /dev/null

echo "* Disabling Apache PHP 7.3 module..."
sudo a2dismod php7.3 > /dev/null

echo "* Enabling Apache PHP 5.6 module..."
sudo a2enmod php5.6 > /dev/null

Expand Down
3 changes: 3 additions & 0 deletions switch-to-php-7.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ sudo a2dismod php7.1 > /dev/null
echo "* Disabling Apache PHP 7.2 module..."
sudo a2dismod php7.2 > /dev/null

echo "* Disabling Apache PHP 7.3 module..."
sudo a2dismod php7.3 > /dev/null

echo "* Enabling Apache PHP 7.0 module..."
sudo a2enmod php7.0 > /dev/null

Expand Down
7 changes: 5 additions & 2 deletions switch-to-php-7.1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
echo "* Disabling Apache PHP 5.6 module..."
sudo a2dismod php5.6 > /dev/null

echo "* Disabling Apache PHP 7.0 module..."
sudo a2dismod php7.0 > /dev/null

echo "* Disabling Apache PHP 7.2 module..."
sudo a2dismod php7.2 > /dev/null

echo "* Disabling Apache PHP 7.0 module..."
sudo a2dismod php7.0 > /dev/null
echo "* Disabling Apache PHP 7.3 module..."
sudo a2dismod php7.3 > /dev/null

echo "* Enabling Apache PHP 7.1 module..."
sudo a2enmod php7.1 > /dev/null
Expand Down
3 changes: 3 additions & 0 deletions switch-to-php-7.2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ sudo a2dismod php7.0 > /dev/null
echo "* Disabling Apache PHP 7.1 module..."
sudo a2dismod php7.1 > /dev/null

echo "* Disabling Apache PHP 7.3 module..."
sudo a2dismod php7.3 > /dev/null

echo "* Enabling Apache PHP 7.2 module..."
sudo a2enmod php7.2 > /dev/null

Expand Down
24 changes: 24 additions & 0 deletions switch-to-php-7.3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

echo "* Disabling Apache PHP 5.6 module..."
sudo a2dismod php5.6 > /dev/null

echo "* Disabling Apache PHP 7.0 module..."
sudo a2dismod php7.0 > /dev/null

echo "* Disabling Apache PHP 7.1 module..."
sudo a2dismod php7.1 > /dev/null

echo "* Disabling Apache PHP 7.2 module..."
sudo a2dismod php7.2 > /dev/null

echo "* Enabling Apache PHP 7.3 module..."
sudo a2enmod php7.3 > /dev/null

echo "* Restarting Apache..."
sudo service apache2 restart > /dev/null

echo "* Switching CLI PHP to 7.3..."
sudo update-alternatives --set php /usr/bin/php7.3 > /dev/null

echo "* Switch to PHP 7.3 complete."