Skip to content

Commit c80c990

Browse files
authored
Merge branch 'master' into master
2 parents 9e5b243 + b70e838 commit c80c990

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# PHP Switch Scripts
1+
# 🔄 PHP Switch Scripts
22

3-
These scripts are designed to aid in the setup of and switching between multiple PHP versions in Ubuntu 16.04 LTS.
3+
These scripts are designed to aid in the setup of and switching between multiple PHP versions in Ubuntu 14.04 LTS or newer.
4+
5+
<img src="assets/images/usage.png" />
46

5-
Currently they support switching between PHP 5.6 and PHP 7.0.
67

78
Please note that these scripts install packages from a third-party repository, provided by [Ondřej Surý](https://twitter.com/oerdnj). More details are available at the repository's [website](https://deb.sury.org/), [PPA page on Launchpad](https://launchpad.net/~ondrej/+archive/ubuntu/php/) and [Twitter account](https://twitter.com/debsuryorg).
89

910
## Requirements
1011

11-
* Ubuntu 16.04.* LTS
12+
* Ubuntu 14.04.* LTS or newer
1213
* Apache 2.4.*
1314

1415
You can check you have the required versions by running the following command.
@@ -20,7 +21,7 @@ lsb_release -a | grep Ubuntu && apache2 -v | grep Apache
2021
You should see something similar to the below.
2122

2223
```
23-
Description: Ubuntu 16.04.3 LTS
24+
Description: Ubuntu 14.04.5 LTS
2425
Server version: Apache/2.4.18 (Ubuntu)
2526
```
2627

@@ -54,6 +55,8 @@ Once setup is complete, you can easily switch between different PHP versions usi
5455
```
5556
./switch-to-php-5.6.sh
5657
./switch-to-php-7.0.sh
58+
./switch-to-php-7.1.sh
59+
./switch-to-php-7.2.sh
5760
```
5861

5962
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.

assets/images/usage.png

45.5 KB
Loading

setup.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ echo "* Installing PHP 5.6..."
1616
sudo apt-get install -y php5.6 php5.6-common php5.6-cli > /dev/null
1717

1818
echo "* Installing PHP 5.6 extensions..."
19-
sudo apt-get install -y php5.6-curl php5.6-mcrypt php5.6-soap php5.6-bz2 php5.6-gd php5.6-mysql php5.6-sqlite3 php5.6-json php5.6-opcache php5.6-xml php5.6-mbstring php5.6-readline php5.6-xmlrpc php5.6-zip > /dev/null
19+
sudo apt-get install -y php5.6-curl php5.6-mcrypt php5.6-soap php5.6-bz2 php5.6-gd php5.6-mysql php5.6-sqlite3 php5.6-json php5.6-opcache php5.6-xml php5.6-mbstring php5.6-readline php5.6-xmlrpc php5.6-zip php-redis > /dev/null
2020

2121
echo "* Installing PHP 7.0..."
2222
sudo apt-get install -y php7.0 php7.0-common php7.0-cli > /dev/null
2323

2424
echo "* Installing PHP 7.0 extensions..."
25-
sudo apt-get install -y php7.0-gd php7.0-mysql php7.0-sqlite3 php7.0-soap php7.0-xsl php7.0-json php7.0-opcache php7.0-mbstring php7.0-readline php7.0-curl php7.0-mcrypt php7.0-xml php7.0-zip > /dev/null
25+
sudo apt-get install -y php7.0-gd php7.0-mysql php7.0-sqlite3 php7.0-soap php7.0-xsl php7.0-json php7.0-opcache php7.0-mbstring php7.0-readline php7.0-curl php7.0-mcrypt php7.0-xml php7.0-zip php-redis > /dev/null
2626

2727
echo "* Installing PHP 7.1..."
2828
sudo apt-get install -y php7.1 php7.1-common php7.1-cli > /dev/null
2929

3030
echo "* Installing PHP 7.1 extensions..."
31-
sudo apt-get install -y php7.1-gd php7.1-mysql php7.1-sqlite3 php7.1-soap php7.1-xsl php7.1-json php7.1-opcache php7.1-mbstring php7.1-readline php7.1-curl php7.1-mcrypt php7.1-xml php7.1-zip > /dev/null
31+
sudo apt-get install -y php7.1-gd php7.1-mysql php7.1-sqlite3 php7.1-soap php7.1-xsl php7.1-json php7.1-opcache php7.1-mbstring php7.1-readline php7.1-curl php7.1-mcrypt php7.1-xml php7.1-zip php-redis > /dev/null
3232

3333
echo "* Installing PHP 7.2..."
3434
sudo apt-get install -y php7.2 php7.2-common php7.2-cli > /dev/null
@@ -41,7 +41,8 @@ sudo apt-get install -y php7.3 php7.3-common php7.3-cli > /dev/null
4141

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
44+
4445
echo "* Installing additional PHP extensions..."
45-
sudo apt-get install -y php-memcache php-memcached > /dev/null
46+
sudo apt-get install -y php-memcache php-memcached php-redis > /dev/null
4647

4748
echo "* Setup complete. You may now use the 'switch-to-php-*.*.sh' scripts."

0 commit comments

Comments
 (0)